Module: Saver::ClassMethods
- Defined in:
- lib/saver.rb
Instance Method Summary collapse
- #save_attribute(attribute, options = {}) ⇒ Object
- #save_attributes(*attributes) ⇒ Object
- #savers ⇒ Object
Instance Method Details
#save_attribute(attribute, options = {}) ⇒ Object
18 19 20 21 |
# File 'lib/saver.rb', line 18 def save_attribute(attribute, = {}) key "#{attribute}_saver", String self.savers[attribute] = [:method] || :to_s end |
#save_attributes(*attributes) ⇒ Object
12 13 14 15 16 |
# File 'lib/saver.rb', line 12 def save_attributes(*attributes) attributes.each do |attr| save_attribute(attr) end end |
#savers ⇒ Object
23 24 25 |
# File 'lib/saver.rb', line 23 def savers @savers ||= {} end |