Module: PreferenceFu::InstanceMethods
- Defined in:
- lib/preference_fu.rb
Instance Method Summary collapse
- #initialize_with_preferences(attributes = nil) {|_self| ... } ⇒ Object
- #preferences_column ⇒ Object
- #prefs ⇒ Object
- #prefs=(hsh) ⇒ Object
Instance Method Details
#initialize_with_preferences(attributes = nil) {|_self| ... } ⇒ Object
59 60 61 62 63 |
# File 'lib/preference_fu.rb', line 59 def initialize_with_preferences(attributes = nil) initialize_without_preferences(attributes) prefs # use this to trigger update_permissions in Preferences yield self if block_given? end |
#preferences_column ⇒ Object
65 66 67 |
# File 'lib/preference_fu.rb', line 65 def preferences_column self.class.preferences_column end |
#prefs ⇒ Object
69 70 71 |
# File 'lib/preference_fu.rb', line 69 def prefs @preferences_object ||= Preferences.new(read_attribute(preferences_column.to_sym), self) end |
#prefs=(hsh) ⇒ Object
73 74 75 |
# File 'lib/preference_fu.rb', line 73 def prefs=(hsh) prefs.store(hsh) end |