Class: Pork::Saver
- Inherits:
-
Object
- Object
- Pork::Saver
- Defined in:
- lib/pork_sandwich/saver.rb
Instance Attribute Summary collapse
-
#rules ⇒ Object
Returns the value of attribute rules.
Instance Method Summary collapse
-
#initialize(rules = {}) ⇒ Saver
constructor
A new instance of Saver.
- #save(to_save, &save_type) ⇒ Object
Constructor Details
#initialize(rules = {}) ⇒ Saver
Returns a new instance of Saver.
13 14 15 |
# File 'lib/pork_sandwich/saver.rb', line 13 def initialize(rules = {}) @rules = rules end |
Instance Attribute Details
#rules ⇒ Object
Returns the value of attribute rules.
11 12 13 |
# File 'lib/pork_sandwich/saver.rb', line 11 def rules @rules end |
Instance Method Details
#save(to_save, &save_type) ⇒ Object
17 18 19 |
# File 'lib/pork_sandwich/saver.rb', line 17 def save(to_save, &save_type) save_type.call(to_save, rules) end |