Enumerize::Base::ClassMethods

Public Instance Methods

enumerize(name, options={}) click to toggle source
# File lib/enumerize/base.rb, line 12
def enumerize(name, options={})
  attr = Attribute.new(self, name, options)
  enumerized_attributes << attr

  unless methods.include?(attr.name)
    _enumerize_module._class_methods.module_eval             def #{attr.name}              enumerized_attributes[:#{attr.name}]            end, __FILE__, __LINE__ + 1
  end

  attr.define_methods!(_enumerize_module)
end
enumerized_attributes() click to toggle source
# File lib/enumerize/base.rb, line 27
def enumerized_attributes
  @enumerized_attributes ||= AttributeMap.new
end
inherited(subclass) click to toggle source
# File lib/enumerize/base.rb, line 31
def inherited(subclass)
  enumerized_attributes.add_dependant subclass.enumerized_attributes
  super
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.