Class: ActiveRecord::Properties::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Properties::Base
- Defined in:
- lib/active_record/properties/base.rb
Direct Known Subclasses
BooleanProperty, CounterProperty, NumberProperty, StringProperty, TranslationProperty
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(name) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/active_record/properties/base.rb', line 6 def initialize(name) @name = name.to_s end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/active_record/properties/base.rb', line 5 def name @name end |
Class Method Details
.add_property_accessor(*suffixes, &block) ⇒ Object
15 16 17 18 |
# File 'lib/active_record/properties/base.rb', line 15 def add_property_accessor(*suffixes, &block) self._property_accessors ||= {} self._property_accessors = _property_accessors.merge(suffixes.to_a => block) end |
.property_accessors ⇒ Object
11 12 13 |
# File 'lib/active_record/properties/base.rb', line 11 def property_accessors self._property_accessors || {} end |