Class: LastFM::Wiki

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

Instance Attribute Summary collapse

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

#contentString

Full content of this entry

Returns:

  • (String)

    the current value of content


6
7
8
# File 'lib/lastfm/wiki.rb', line 6

def content
  @content
end

#publishedTime

Date the information in this entry was published

Returns:

  • (Time)

    the current value of published


6
7
8
# File 'lib/lastfm/wiki.rb', line 6

def published
  @published
end

#summaryString

Short summary of the information in this entry

Returns:

  • (String)

    the current value of summary


6
7
8
# File 'lib/lastfm/wiki.rb', line 6

def summary
  @summary
end

Instance Method Details

#update_from_node(node) ⇒ Object


8
9
10
11
12
13
14
15
16
17
# File 'lib/lastfm/wiki.rb', line 8

def update_from_node(node)
  case node.name.to_sym
    when :published
      self.published = Time.parse(node.content) rescue nil
    when :summary #TODO: Remove CDATA wrapper
      self.summary = node.content
    when :content #TODO: Remove CDATA wrapper
      self.content = node.content
  end
end