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
52 53 54 55 56 |
# File 'lib/preference_fu.rb', line 52 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
58 59 60 |
# File 'lib/preference_fu.rb', line 58 def preferences_column self.class.preferences_column end |
#prefs ⇒ Object
62 63 64 |
# File 'lib/preference_fu.rb', line 62 def prefs @preferences_object ||= Preferences.new(read_attribute(preferences_column.to_sym), self) end |
#prefs=(hsh) ⇒ Object
66 67 68 |
# File 'lib/preference_fu.rb', line 66 def prefs=(hsh) prefs.store(hsh) end |