def attribute(name, type)
      new_attribute = Attribute.new(name, type)

      attributes << new_attribute

      define_method(name) do
        self.class.attributes.find(name).value(self)
      end
      alias_method "#{name}?", name if type == Boolean

      new_attribute
    end
def attribute(name, type)
      new_attribute = Attribute.new(name, type)

      attributes << new_attribute

      define_method(name) do
        self.class.attributes.find(name).value(self)
      end
      alias_method "#{name}?", name if type == Boolean

      new_attribute
    end
Registers an attribute (name + type), defining the getter method (and in the
 boolean case an additional predicated alias).