Sha256: 799ccea8ac4d05708fa0937267ecca73292aa16e539fba01263e0bbfdf5b2669

Contents?: true

Size: 463 Bytes

Versions: 10

Compression:

Stored size: 463 Bytes

Contents

module Stellar
  class TransactionPage
    include Contracts
    include Enumerable

    Contract Hyperclient::Link => Any
    def initialize(resource)
      @resource = resource
    end

    def each
      @resource.records.each do |tx|
        yield tx if block_given?
      end  
    end

    Contract None => TransactionPage
    def next_page
      self.class.new(@resource.next)
    end

    def next_page!
      @resource = @resource.next
    end

  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
stellar-sdk-0.8.0 lib/stellar/transaction_page.rb
stellar-sdk-0.7.0 lib/stellar/transaction_page.rb
stellar-sdk-0.6.0 lib/stellar/transaction_page.rb
stellar-sdk-0.5.0 lib/stellar/transaction_page.rb
stellar-sdk-0.4.0 lib/stellar/transaction_page.rb
stellar-sdk-0.3.0 lib/stellar/transaction_page.rb
stellar-sdk-0.2.0 lib/stellar/transaction_page.rb
stellar-sdk-0.1.1 lib/stellar/transaction_page.rb
stellar-sdk-0.1.0 lib/stellar/transaction_page.rb
stellar-lib-0.0.2 lib/stellar/transaction_page.rb