Class: OCLC::Classify::Recommendations

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#recommendationsObject (readonly)

Returns the value of attribute recommendations.



119
120
121
# File 'lib/oclc_classify.rb', line 119

def recommendations
  @recommendations
end

Instance Method Details

#processObject



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