Class: Spree::Preferences::StaticModelPreferences::Definition
- Inherits:
-
Object
- Object
- Spree::Preferences::StaticModelPreferences::Definition
- Defined in:
- lib/spree/preferences/static_model_preferences.rb
Instance Attribute Summary collapse
-
#preferences ⇒ Object
readonly
Returns the value of attribute preferences.
Instance Method Summary collapse
- #[]=(key, value) ⇒ Object
- #fetch(key, &block) ⇒ Object
-
#initialize(klass, hash) ⇒ Definition
constructor
A new instance of Definition.
- #to_hash ⇒ Object
Constructor Details
#initialize(klass, hash) ⇒ Definition
Returns a new instance of Definition.
9 10 11 12 |
# File 'lib/spree/preferences/static_model_preferences.rb', line 9 def initialize(klass, hash) @klass = klass @preferences = hash.symbolize_keys end |
Instance Attribute Details
#preferences ⇒ Object (readonly)
Returns the value of attribute preferences.
7 8 9 |
# File 'lib/spree/preferences/static_model_preferences.rb', line 7 def preferences @preferences end |
Instance Method Details
#[]=(key, value) ⇒ Object
18 19 20 |
# File 'lib/spree/preferences/static_model_preferences.rb', line 18 def []=(key, value) # ignores assignment end |
#fetch(key, &block) ⇒ Object
14 15 16 |
# File 'lib/spree/preferences/static_model_preferences.rb', line 14 def fetch(key, &block) @preferences.fetch(key, &block) end |
#to_hash ⇒ Object
22 23 24 |
# File 'lib/spree/preferences/static_model_preferences.rb', line 22 def to_hash @preferences.deep_dup end |