Class: Rnvivo::Nvivo
Constant Summary collapse
- API_URL =
"http://www.nvivo.es/api/request.php"
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
- #artistGetEvents(artist, country = 'all', past = false) ⇒ Object
- #cityGetEvents(city, country = 'all') ⇒ Object
-
#initialize(key, timeout = 30) ⇒ Nvivo
constructor
A new instance of Nvivo.
- #userGetEvents(user) ⇒ Object
- #venueFind(venue_name, country = 'all') ⇒ Object
- #venueGet(venue_id) ⇒ Object
- #venueGetEvents(venue_id, past = false) ⇒ Object
Constructor Details
#initialize(key, timeout = 30) ⇒ Nvivo
Returns a new instance of Nvivo.
25 26 27 28 |
# File 'lib/rnvivo.rb', line 25 def initialize(key, timeout = 30) @api_key = key @timeout = timeout end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
23 24 25 |
# File 'lib/rnvivo.rb', line 23 def api_key @api_key end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
23 24 25 |
# File 'lib/rnvivo.rb', line 23 def timeout @timeout end |
Instance Method Details
#artistGetEvents(artist, country = 'all', past = false) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/rnvivo.rb', line 42 def artistGetEvents(artist, country='all', past = false) raise ArgumentError, 'You must indicate an artist' if artist.blank? = query 'artist.getEvents', :artist => artist, :county_iso => country, :past => past deal_with_response_for do |r| return nested_result r, 'response', 'events', 'event' end end |
#cityGetEvents(city, country = 'all') ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rnvivo.rb', line 30 def cityGetEvents(city, country = 'all') raise ArgumentError, 'You must indicate a city' if city.blank? = query 'city.getEvents', :city => city, :country_iso => country deal_with_response_for do |r| return nested_result r, 'response', 'events', 'event' end end |
#userGetEvents(user) ⇒ Object
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/rnvivo.rb', line 67 def userGetEvents(user) raise ArgumentError, 'You must indicate a user' if user.blank? = query 'user.getEvents', :user => user deal_with_response_for() do |r| return nested_result r, 'response', 'events', 'event' end end |
#venueFind(venue_name, country = 'all') ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/rnvivo.rb', line 78 def venueFind(venue_name, country='all') raise ArgumentError, 'You must indicate a venue name' if venue_name.blank? = query 'venue.find', :venue_name => venue_name, :country_iso => country deal_with_response_for do |r| return nested_result r, 'response', 'venues', 'venue' end end |
#venueGet(venue_id) ⇒ Object
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/rnvivo.rb', line 90 def venueGet(venue_id) raise ArgumentError, 'You must inidicate a venue id' if venue_id.blank? = query 'venue.get', :venue_id => venue_id deal_with_response_for do |r| return nested_result r, 'response', 'venue' end end |
#venueGetEvents(venue_id, past = false) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/rnvivo.rb', line 55 def venueGetEvents(venue_id, past = false) raise ArgumentError, 'You must indicate a venue' if venue_id.blank? = query 'venue.getEvents', :venue_id => venue_id, :past => past deal_with_response_for do |r| return nested_result r, 'response', 'events', 'event' end end |