Class: SimpleModel::Config
- Inherits:
-
Object
- Object
- SimpleModel::Config
- Defined in:
- lib/simple_model/config.rb
Constant Summary collapse
- DEFAULTS =
{ :initialize_defaults => false, :attributes_store => (RUBY_VERSION >= "2.2" ? :symbol : :string) # OPTIONS => :string, :symbol, :indifferent }.freeze
- ATTRIBUTE_STORES =
{ :symbol => :to_sym, :string => :to_s, :indifferent => :to_s }.freeze
Instance Attribute Summary collapse
-
#attributes_store ⇒ Object
Returns the value of attribute attributes_store.
-
#initialize_defaults ⇒ Object
(also: #initialize_defaults?)
Returns the value of attribute initialize_defaults.
Instance Method Summary collapse
- #attibutes_store_cast ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
Instance Attribute Details
#attributes_store ⇒ Object
Returns the value of attribute attributes_store.
17 18 19 |
# File 'lib/simple_model/config.rb', line 17 def attributes_store @attributes_store end |
#initialize_defaults ⇒ Object Also known as: initialize_defaults?
Returns the value of attribute initialize_defaults.
14 15 16 |
# File 'lib/simple_model/config.rb', line 14 def initialize_defaults @initialize_defaults end |
Instance Method Details
#attibutes_store_cast ⇒ Object
25 26 27 |
# File 'lib/simple_model/config.rb', line 25 def attibutes_store_cast ATTRIBUTE_STORES[attributes_store] end |