Module: Attrio::ClassMethods
- Defined in:
- lib/attrio.rb
Instance Method Summary collapse
Instance Method Details
#const_missing(name) ⇒ Object
44 45 46 |
# File 'lib/attrio.rb', line 44 def const_missing(name) Attrio::AttributesParser.cast_type(name) || super end |
#define_attributes(options = {}, &block) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/attrio.rb', line 29 def define_attributes( = {}, &block) [:as] ||= :attributes cattr_accessor [:as].to_sym class_eval(<<-EOS) @@#{[:as].to_s} ||= {} EOS self.define_attrio_new([:as]) self.define_attrio_reset([:as]) self.define_attrio_inspect([:as]) unless [:inspect] == false Attrio::AttributesParser.new(self, , &block) end |