Class: OCLC::Classify::Recommendations
- Inherits:
-
Object
- Object
- OCLC::Classify::Recommendations
- Defined in:
- lib/oclc_classify.rb
Instance Attribute Summary collapse
-
#recommendations ⇒ Object
readonly
Returns the value of attribute recommendations.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Recommendations
constructor
A new instance of Recommendations.
- #process ⇒ Object
Constructor Details
#initialize(xml) ⇒ Recommendations
Returns a new instance of Recommendations.
121 122 123 124 |
# File 'lib/oclc_classify.rb', line 121 def initialize(xml) @xml = xml @recommendations = [] end |
Instance Attribute Details
#recommendations ⇒ Object (readonly)
Returns the value of attribute recommendations.
119 120 121 |
# File 'lib/oclc_classify.rb', line 119 def recommendations @recommendations end |
Instance Method Details
#process ⇒ Object
126 127 128 129 130 131 132 133 134 135 |
# File 'lib/oclc_classify.rb', line 126 def process @xml.each do |r| box = {} k = r.attributes.keys r.attribute_nodes.each_with_index do |a, idx| box[k[idx]] = a.value end @recommendations << box end end |