Class: PMC::EfetchXMLSummaries
- Inherits:
-
Object
- Object
- PMC::EfetchXMLSummaries
- Includes:
- Enumerable
- Defined in:
- lib/pmc/efetch.rb
Overview
Stores the
Instance Attribute Summary collapse
-
#summaries ⇒ Object
readonly
Returns the value of attribute summaries.
Instance Method Summary collapse
- #[](i) ⇒ Object
- #each ⇒ Object
-
#initialize ⇒ EfetchXMLSummaries
constructor
A new instance of EfetchXMLSummaries.
-
#push(e) ⇒ Object
Checks that e is Nokogiri::XML::Document object or nil.
Constructor Details
#initialize ⇒ EfetchXMLSummaries
Returns a new instance of EfetchXMLSummaries.
34 35 36 |
# File 'lib/pmc/efetch.rb', line 34 def initialize @summaries=[] end |
Instance Attribute Details
#summaries ⇒ Object (readonly)
Returns the value of attribute summaries.
33 34 35 |
# File 'lib/pmc/efetch.rb', line 33 def summaries @summaries end |
Instance Method Details
#[](i) ⇒ Object
38 39 40 |
# File 'lib/pmc/efetch.rb', line 38 def [](i) @summaries[i] end |
#each ⇒ Object
41 42 43 44 45 |
# File 'lib/pmc/efetch.rb', line 41 def each @summaries.each do |e| yield e end end |
#push(e) ⇒ Object
Checks that e is Nokogiri::XML::Document object or nil
47 48 49 50 |
# File 'lib/pmc/efetch.rb', line 47 def push(e) raise "Not a Nokogiri::Document or nil object" unless e.nil? or e.is_a? Nokogiri::XML::Document @summaries.push(e) end |