Class: AttributeExtras::AttributeExtra
- Inherits:
-
Module
- Object
- Module
- AttributeExtras::AttributeExtra
- Defined in:
- lib/attribute_extras.rb
Overview
Parent class of the various extras.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #included(clazz) ⇒ Object
-
#initialize(name, attributes, perform) ⇒ AttributeExtra
constructor
A new instance of AttributeExtra.
Constructor Details
#initialize(name, attributes, perform) ⇒ AttributeExtra
Returns a new instance of AttributeExtra.
11 12 13 14 |
# File 'lib/attribute_extras.rb', line 11 def initialize(name, attributes, perform) @name = name define_extra(name, attributes, perform) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/attribute_extras.rb', line 9 def name @name end |
Instance Method Details
#included(clazz) ⇒ Object
16 17 18 |
# File 'lib/attribute_extras.rb', line 16 def included(clazz) clazz.before_validation(name) end |