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 = attributes @attributes.each_pair do |key, value| self.class.send(:define_method, key) do @attributes[key] end end end end end