Class: LastFM::Tag

Inherits:
Struct
  • Object
show all
Defined in:
lib/lastfm/tag.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

#countFixnum



9
10
11
# File 'lib/lastfm/tag.rb', line 9

def count
  @count
end

#nameString



9
10
11
# File 'lib/lastfm/tag.rb', line 9

def name
  @name
end

#reachFixnum



9
10
11
# File 'lib/lastfm/tag.rb', line 9

def reach
  @reach
end

#streamableBoolean



9
10
11
# File 'lib/lastfm/tag.rb', line 9

def streamable
  @streamable
end

#urlString



9
10
11
# File 'lib/lastfm/tag.rb', line 9

def url
  @url
end

#wikiLastFM::Wiki



9
10
11
# File 'lib/lastfm/tag.rb', line 9

def wiki
  @wiki
end

Instance Method Details

#update_from_node(node) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/lastfm/tag.rb', line 11

def update_from_node(node)
  case node.name.to_sym
    when :name
      self.name = node.content
    when :url
      self.url = node.content
    when :reach
      self.reach = node.content.to_i
    when :count, :taggings
      self.count = node.content.to_i
    when :streamable
      self.streamable = (node.content == '1')
    when :wiki
      self.wiki = LastFM::Wiki.from_xml(node)
  end
end