Class: EML::UK::Responses::Card::Transaction
- Inherits:
-
EML::UK::Response
- Object
- Response
- EML::UK::Response
- EML::UK::Responses::Card::Transaction
- Extended by:
- T::Sig
- Defined in:
- lib/eml/uk/responses/card/transaction.rb
Instance Method Summary collapse
-
#initialize(response, id: nil) ⇒ Transaction
constructor
A new instance of Transaction.
- #transactions ⇒ Object
Methods inherited from Response
#body, #error, field, #headers, #http_status, #success?, #url
Constructor Details
#initialize(response, id: nil) ⇒ Transaction
Returns a new instance of Transaction.
14 15 16 17 18 19 20 21 |
# File 'lib/eml/uk/responses/card/transaction.rb', line 14 def initialize(response, id: nil) super @transactions = T.let( nil, T.nilable(T::Array[::EML::UK::Models::Transaction]) ) end |
Instance Method Details
#transactions ⇒ Object
24 25 26 27 28 29 |
# File 'lib/eml/uk/responses/card/transaction.rb', line 24 def transactions @transactions ||= body["transactions"]. each_with_object([]) do |transaction, array| array << ::EML::UK::Models::Transaction.new(transaction) end end |