Class: ActiveRecord::Properties::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/properties/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#nameObject (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_accessorsObject



11
12
13
# File 'lib/active_record/properties/base.rb', line 11

def property_accessors
  self._property_accessors || {}
end