Class: PensioAPI::Responses::SuccessCallback

Inherits:
Transaction show all
Extended by:
Forwardable
Defined in:
lib/pensio_api/responses/success_callback.rb

Instance Attribute Summary

Attributes inherited from Base

#raw

Instance Method Summary collapse

Methods inherited from Transaction

#initialize

Methods included from Mixins::HasTransactions

included, #last

Methods inherited from Base

#initialize, #success?

Methods included from Mixins::MethodMissing

#method_missing

Constructor Details

This class inherits a constructor from PensioAPI::Responses::Transaction

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PensioAPI::Mixins::MethodMissing

Instance Method Details

#chargeObject



16
17
18
# File 'lib/pensio_api/responses/success_callback.rb', line 16

def charge
  @transactions.last
end

#eachObject



8
9
10
# File 'lib/pensio_api/responses/success_callback.rb', line 8

def each
  [reservation, charge].each { |t| yield t }
end

#reservationObject



12
13
14
# File 'lib/pensio_api/responses/success_callback.rb', line 12

def reservation
  @transactions.first
end