Class: LastFM::Venue

Inherits:
Struct
  • Object
show all
Defined in:
lib/lastfm/venue.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

from_xml, #initialize, package

Constructor Details

This class inherits a constructor from LastFM::Struct

Instance Attribute Details

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



2
3
4
# File 'lib/lastfm/venue.rb', line 2

def id
  @id
end

#imagesObject

Returns the value of attribute images

Returns:

  • (Object)

    the current value of images



2
3
4
# File 'lib/lastfm/venue.rb', line 2

def images
  @images
end

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



2
3
4
# File 'lib/lastfm/venue.rb', line 2

def location
  @location
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/lastfm/venue.rb', line 2

def name
  @name
end

#phone_numberObject

Returns the value of attribute phone_number

Returns:

  • (Object)

    the current value of phone_number



2
3
4
# File 'lib/lastfm/venue.rb', line 2

def phone_number
  @phone_number
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



2
3
4
# File 'lib/lastfm/venue.rb', line 2

def url
  @url
end

#websiteObject

Returns the value of attribute website

Returns:

  • (Object)

    the current value of website



2
3
4
# File 'lib/lastfm/venue.rb', line 2

def website
  @website
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