Class: Pork::Saver

Inherits:
Object
  • Object
show all
Defined in:
lib/pork_sandwich/saver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rulesObject

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