Sha256: d4795b000bb56288e8583b6d8a917e6d6e5c146afa4600c7c10c337671789ca1

Contents?: true

Size: 848 Bytes

Versions: 11

Compression:

Stored size: 848 Bytes

Contents

# typed: strict
# frozen_string_literal: true

module EML
  module UK
    module Responses
      module Card
        class Transaction < ::EML::UK::Response
          extend T::Sig

          field :count

          sig { params(response: HTTP::Response, id: T.nilable(String)).void }
          def initialize(response, id: nil)
            super

            @transactions = T.let(
              nil,
              T.nilable(T::Array[::EML::UK::Models::Transaction])
            )
          end

          sig { returns(T::Array[::EML::UK::Models::Transaction]) }
          def transactions
            @transactions ||= body["transactions"].
              each_with_object([]) do |transaction, array|
                array << ::EML::UK::Models::Transaction.new(transaction)
              end
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
eml-3.0.0 lib/eml/uk/responses/card/transaction.rb
eml-2.2.0 lib/eml/uk/responses/card/transaction.rb
eml-2.1.8 lib/eml/uk/responses/card/transaction.rb
eml-2.1.7 lib/eml/uk/responses/card/transaction.rb
eml-2.1.6 lib/eml/uk/responses/card/transaction.rb
eml-2.1.5 lib/eml/uk/responses/card/transaction.rb
eml-2.1.4 lib/eml/uk/responses/card/transaction.rb
eml-2.1.3 lib/eml/uk/responses/card/transaction.rb
eml-2.1.2 lib/eml/uk/responses/card/transaction.rb
eml-2.1.1 lib/eml/uk/responses/card/transaction.rb
eml-2.1.0 lib/eml/uk/responses/card/transaction.rb