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

Returns the current value of count.

Returns:

  • (Fixnum)

    the current value of count



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

def count
  @count
end

#nameString

Returns the current value of name.

Returns:

  • (String)

    the current value of name



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

def name
  @name
end

#reachFixnum

Returns the current value of reach.

Returns:

  • (Fixnum)

    the current value of reach



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

def reach
  @reach
end

#streamableBoolean

Returns the current value of streamable.

Returns:

  • (Boolean)

    the current value of streamable



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

def streamable
  @streamable
end

#urlString

Returns the current value of url.

Returns:

  • (String)

    the current value of url



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

def url
  @url
end

#wikiLastFM::Wiki

Returns the current value of wiki.

Returns:



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