Class: ActiveRecord::CustomAttributes::CustomAttributeDefinitionHelper
- Inherits:
-
Object
- Object
- ActiveRecord::CustomAttributes::CustomAttributeDefinitionHelper
- Defined in:
- lib/active_record/custom_attributes.rb
Instance Attribute Summary collapse
-
#defined_attributes ⇒ Object
readonly
Returns the value of attribute defined_attributes.
-
#defined_validations ⇒ Object
readonly
Returns the value of attribute defined_validations.
Instance Method Summary collapse
-
#initialize(extra_field_types) ⇒ CustomAttributeDefinitionHelper
constructor
A new instance of CustomAttributeDefinitionHelper.
Constructor Details
#initialize(extra_field_types) ⇒ CustomAttributeDefinitionHelper
Returns a new instance of CustomAttributeDefinitionHelper.
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/active_record/custom_attributes.rb', line 54 def initialize extra_field_types @defined_attributes = {} @defined_validations = {} extra_field_types.each do |key, value| class_eval do define_method key do |*args| define_field(key, *args) end end end end |
Instance Attribute Details
#defined_attributes ⇒ Object (readonly)
Returns the value of attribute defined_attributes.
73 74 75 |
# File 'lib/active_record/custom_attributes.rb', line 73 def defined_attributes @defined_attributes end |
#defined_validations ⇒ Object (readonly)
Returns the value of attribute defined_validations.
73 74 75 |
# File 'lib/active_record/custom_attributes.rb', line 73 def defined_validations @defined_validations end |