Class: Paytureman::PaymentPersistence

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/service/payment_persistence.rb

Instance Method Summary collapse

Instance Method Details

#load(memento) ⇒ Object



7
8
9
# File 'lib/service/payment_persistence.rb', line 7

def load(memento)
  memento.type.constantize.new_from_memento(memento)
end

#save(payment, memento) ⇒ Object



11
12
13
14
# File 'lib/service/payment_persistence.rb', line 11

def save(payment, memento)
  payment.save_to_memento(memento)
  memento.type = payment.class.name
end