Class: ModSpox::Models::Setting
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- ModSpox::Models::Setting
- Defined in:
- lib/mod_spox/models/Setting.rb
Overview
Attributes provided by model:
- name
-
name of the setting
- value
-
value of the setting
This model can be used to store complex objects. These objects are dumped and stored for later retrieval TODO: remove [] from any usage
Class Method Summary collapse
Instance Method Summary collapse
-
#name=(setting_name) ⇒ Object
serialize(:value, :format => :marshal).
- #value ⇒ Object
- #value=(val) ⇒ Object
Class Method Details
Instance Method Details
#name=(setting_name) ⇒ Object
serialize(:value, :format => :marshal)
14 15 16 17 |
# File 'lib/mod_spox/models/Setting.rb', line 14 def name=(setting_name) setting_name.downcase! super(setting_name) end |
#value ⇒ Object
24 25 26 |
# File 'lib/mod_spox/models/Setting.rb', line 24 def value return values[:value] ? Marshal.load(values[:value].unpack('m')[0]) : nil end |
#value=(val) ⇒ Object
19 20 21 22 |
# File 'lib/mod_spox/models/Setting.rb', line 19 def value=(val) val = [Marshal.dump(val.dup)].pack('m') super(val) end |