Class: NDLSearch::SearchResult

Inherits:
Object
  • Object
show all
Defined in:
lib/ndl_search.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ SearchResult

Returns a new instance of SearchResult.



34
35
36
# File 'lib/ndl_search.rb', line 34

def initialize(xml)
  @resource = xml
end

Instance Attribute Details

#resourceObject

Returns the value of attribute resource.



32
33
34
# File 'lib/ndl_search.rb', line 32

def resource
  @resource
end

Instance Method Details

#itemsObject



38
39
40
# File 'lib/ndl_search.rb', line 38

def items
  @items ||= @resource.get_elements('/rss/channel/item').map{|item| ::NDLSearch::Item.new(item) }
end