Class: Maidcafe::ResultSet
- Inherits:
-
ResultItem
- Object
- ResultItem
- Maidcafe::ResultSet
- Defined in:
- lib/ruby-maidcafe.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#generator ⇒ Object
Returns the value of attribute generator.
-
#items ⇒ Object
Returns the value of attribute items.
-
#language ⇒ Object
Returns the value of attribute language.
-
#link ⇒ Object
Returns the value of attribute link.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #attr_to_tag ⇒ Object
-
#initialize(type, xml) ⇒ ResultSet
constructor
A new instance of ResultSet.
Methods inherited from ResultItem
Constructor Details
#initialize(type, xml) ⇒ ResultSet
Returns a new instance of ResultSet.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/ruby-maidcafe.rb', line 78 def initialize(type, xml) @items = [] read xml xml.elements.each('channel/item') do |item| @items.push( if item.elements['image']; Moe.new(type, item) elsif item.elements['tid']; Prefecture.new(item) elsif item.elements['cid']; Category.new(item) elsif item.elements['sid']; Shop.new(item) elsif item.elements['keytype']; Type.new(item) else; raise ArgumentError.new(item.inspect) end ) end end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
76 77 78 |
# File 'lib/ruby-maidcafe.rb', line 76 def description @description end |
#generator ⇒ Object
Returns the value of attribute generator.
76 77 78 |
# File 'lib/ruby-maidcafe.rb', line 76 def generator @generator end |
#items ⇒ Object
Returns the value of attribute items.
76 77 78 |
# File 'lib/ruby-maidcafe.rb', line 76 def items @items end |
#language ⇒ Object
Returns the value of attribute language.
76 77 78 |
# File 'lib/ruby-maidcafe.rb', line 76 def language @language end |
#link ⇒ Object
Returns the value of attribute link.
76 77 78 |
# File 'lib/ruby-maidcafe.rb', line 76 def link @link end |
#title ⇒ Object
Returns the value of attribute title.
76 77 78 |
# File 'lib/ruby-maidcafe.rb', line 76 def title @title end |
Instance Method Details
#attr_to_tag ⇒ Object
94 95 96 97 |
# File 'lib/ruby-maidcafe.rb', line 94 def attr_to_tag {:title => 'channel/title', :link => 'channel/link', :description => 'channel/description', :language => 'channel/language', :generator => 'channel/generator'} end |