Class: AtomFeed::OpenSearch
Instance Method Summary collapse
-
#initialize(node) ⇒ OpenSearch
constructor
Initializes the Open Search extensions.
-
#items_per_page ⇒ Object
def start_page @node.at_xpath(“atom:feed/opensearch:startPage”, ::AtomFeed::NS).content.to_i rescue nil end.
- #present? ⇒ Boolean
-
#queries ⇒ Object
queries.
- #start_index ⇒ Object
- #total_results ⇒ Object
Constructor Details
#initialize(node) ⇒ OpenSearch
Initializes the Open Search extensions.
6 7 8 |
# File 'lib/atom_feed/open_search.rb', line 6 def initialize(node) @node = node end |
Instance Method Details
#items_per_page ⇒ Object
def start_page
@node.at_xpath("atom:feed/opensearch:startPage", ::AtomFeed::NS).content.to_i rescue nil
end
28 29 30 |
# File 'lib/atom_feed/open_search.rb', line 28 def items_per_page @node.at_xpath("atom:feed/opensearch:itemsPerPage", ::AtomFeed::NS).content.to_i rescue nil end |
#present? ⇒ Boolean
10 11 12 |
# File 'lib/atom_feed/open_search.rb', line 10 def present? !self.total_results.nil? end |
#queries ⇒ Object
queries
33 34 35 36 |
# File 'lib/atom_feed/open_search.rb', line 33 def queries nodes = @node.xpath("atom:feed/opensearch:Query", ::AtomFeed::NS) rescue nil nodes.map { |node| OpenSearchQuery.new(node) } if nodes end |