lib/zelda/base.rb in zelda-1.2.0 vs lib/zelda/base.rb in zelda-1.2.1

- old
+ new

@@ -1,12 +1,14 @@ module Zelda # Abstract base class to provide common functionality of Zelda importer classes. # Every key in the hash is turned into a method, returning the value. class Base def initialize(attributes={}) - attributes.each_pair do |key, value| + @attributes = attributes + + @attributes.each_pair do |key, value| self.class.send(:define_method, key) do - value + @attributes[key] end end end end end \ No newline at end of file