Guest User

Untitled

a guest
Feb 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. require File.dirname(__FILE__) + '/base'
  2.  
  3. module Upcoming
  4. class Event < Base
  5.  
  6. base_uri 'upcoming.yahooapis.com'
  7.  
  8. def initialize(params)
  9. @params = params['rsp'].nil? ? params : params['rsp']['event']
  10. end
  11.  
  12. def self.find(id)
  13. params = get('/services/rest/', :query => {:method => 'event.getInfo', :event_id => id})
  14. self.new(params)
  15. end
  16.  
  17. def method_missing(method_name, *args)
  18. @params[method_name.to_s] if @params.has_key?(method_name.to_s)
  19. end
  20.  
  21. end
  22. end
Add Comment
Please, Sign In to add comment