Module: SuperSettings::Attributes
- Included in:
- HistoryItem, Setting, Storage::HistoryAttributes
- Defined in:
- lib/super_settings/attributes.rb
Overview
Interface to expose mass setting attributes on an object. Setting attributes with a hash will simply call the attribute writers for each key in the hash.
Instance Method Summary collapse
Instance Method Details
#attributes=(values) ⇒ Object
11 12 13 14 15 |
# File 'lib/super_settings/attributes.rb', line 11 def attributes=(values) values.each do |name, value| send(:"#{name}=", value) if respond_to?(:"#{name}=", true) end end |
#initialize(attributes = nil) ⇒ Object
7 8 9 |
# File 'lib/super_settings/attributes.rb', line 7 def initialize(attributes = nil) self.attributes = attributes if attributes end |