Class: ActiveRecord::TypedStore::DSL
- Inherits:
-
Object
- Object
- ActiveRecord::TypedStore::DSL
- Defined in:
- lib/active_record/typed_store/dsl.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
Instance Method Summary collapse
- #accessors ⇒ Object
- #decimal(name, options = {}) ⇒ Object
-
#initialize(accessors = true) {|_self| ... } ⇒ DSL
constructor
A new instance of DSL.
Constructor Details
#initialize(accessors = true) {|_self| ... } ⇒ DSL
Returns a new instance of DSL.
7 8 9 10 11 |
# File 'lib/active_record/typed_store/dsl.rb', line 7 def initialize(accessors=true) @accessors = accessors @columns = [] yield self end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
5 6 7 |
# File 'lib/active_record/typed_store/dsl.rb', line 5 def columns @columns end |
Instance Method Details
#accessors ⇒ Object
13 14 15 |
# File 'lib/active_record/typed_store/dsl.rb', line 13 def accessors @columns.select(&:accessor?).map(&:name) end |