Class: Archives::Item

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

Overview

contains each item’s information and converts XML format to Ruby format

Instance Method Summary collapse

Constructor Details

#initialize(doc) ⇒ Item

creates Item class object from libxml node input



7
8
9
10
11
12
13
14
# File 'lib/archives/item.rb', line 7

def initialize(doc)
			if cs = doc.children
cs.each do |c|
	Item.class_eval("attr_accessor :#{c.name}")
	self.instance_variable_set("@#{c.name}", c.content)
end
			end
end