Class: Pay::FakeProcessor::Charge

Inherits:
Object
  • Object
show all
Defined in:
lib/pay/fake_processor/charge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pay_charge) ⇒ Charge

Returns a new instance of Charge.



8
9
10
# File 'lib/pay/fake_processor/charge.rb', line 8

def initialize(pay_charge)
  @pay_charge = pay_charge
end

Instance Attribute Details

#pay_chargeObject (readonly)

Returns the value of attribute pay_charge.



4
5
6
# File 'lib/pay/fake_processor/charge.rb', line 4

def pay_charge
  @pay_charge
end

Instance Method Details

#chargeObject



12
13
14
# File 'lib/pay/fake_processor/charge.rb', line 12

def charge
  pay_charge
end

#refund!(amount_to_refund) ⇒ Object



16
17
18
# File 'lib/pay/fake_processor/charge.rb', line 16

def refund!(amount_to_refund)
  pay_charge.update(amount_refunded: amount_to_refund)
end