Class: LastFM::Venue
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#images ⇒ Object
Returns the value of attribute images.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#url ⇒ Object
Returns the value of attribute url.
-
#website ⇒ Object
Returns the value of attribute website.
Class Method Summary collapse
-
.get_events(params) ⇒ Object
Get a list of upcoming events for a venue.
-
.get_past_events(params) ⇒ Object
Get a paginated list of all the events held at this venue in the past.
-
.search(params) ⇒ Object
Search for a venue by venue name.
Instance Method Summary collapse
Methods inherited from Struct
from_xml, inherited, #initialize, package, #to_json
Constructor Details
This class inherits a constructor from LastFM::Struct
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id
2 3 4 |
# File 'lib/lastfm/venue.rb', line 2 def id @id end |
#images ⇒ Object
Returns the value of attribute images
2 3 4 |
# File 'lib/lastfm/venue.rb', line 2 def images @images end |
#location ⇒ Object
Returns the value of attribute location
2 3 4 |
# File 'lib/lastfm/venue.rb', line 2 def location @location end |
#name ⇒ Object
Returns the value of attribute name
2 3 4 |
# File 'lib/lastfm/venue.rb', line 2 def name @name end |
#phone_number ⇒ Object
Returns the value of attribute phone_number
2 3 4 |
# File 'lib/lastfm/venue.rb', line 2 def phone_number @phone_number end |
#url ⇒ Object
Returns the value of attribute url
2 3 4 |
# File 'lib/lastfm/venue.rb', line 2 def url @url end |
#website ⇒ Object
Returns the value of attribute website
2 3 4 |
# File 'lib/lastfm/venue.rb', line 2 def website @website end |
Class Method Details
.get_events(params) ⇒ Object
Get a list of upcoming events for a venue.
32 33 34 |
# File 'lib/lastfm/venue.rb', line 32 def get_events( params ) LastFM.get( "venue.getEvents", params ) end |
.get_past_events(params) ⇒ Object
Get a paginated list of all the events held at this venue in the past.
43 44 45 |
# File 'lib/lastfm/venue.rb', line 43 def get_past_events( params ) LastFM.get( "venue.getPastEvents", params ) end |
.search(params) ⇒ Object
Search for a venue by venue name.
54 55 56 |
# File 'lib/lastfm/venue.rb', line 54 def search( params ) LastFM.get( "venue.search", params ) end |
Instance Method Details
#update_from_node(node) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/lastfm/venue.rb', line 4 def update_from_node(node) case node.name.to_sym when :id self.id = node.content.to_i when :name self.name = node.content when :location # ??? city, country, street, postalcode, geo:lat, geo:long when :url self.url = node.content when :website self.website = node.content when :phoneNumber self.phone_number = node.content when :image self.images ||= {} self.images.merge!({node['size'].to_sym => node.content}) end end |