Sha256: 532d07016c0b47757d3fae7947a72afa1d334ee3b73e03c2b0ff4ab562a57ae8

Contents?: true

Size: 855 Bytes

Versions: 7

Compression:

Stored size: 855 Bytes

Contents

module StellarClient
  class SendPaymentResponse < BaseResponse

    attribute :body, Coercers::IndifferentHash, lazy: true, default: :default_body
    attribute :hash, String, lazy: true, default: :default_hash
    attribute :result_xdr, String, lazy: true, default: :default_result_xdr
    attribute :ledger, Integer, lazy: true, default: :default_ledger
    attribute :code_str, String, lazy: true, default: :default_code_str
    attribute :message, String, lazy: true, default: :default_message

    private

    def default_body
      JSON.parse(raw_response.body)
    end

    def default_hash
      body[:hash]
    end

    def default_result_xdr
      body[:result_xdr]
    end

    def default_ledger
      body[:ledger]
    end

    def default_code_str
      body[:code]
    end

    def default_message
      body[:message]
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stellar_client-0.8.0 lib/stellar_client/responses/send_payment_response.rb
stellar_client-0.7.0 lib/stellar_client/responses/send_payment_response.rb
stellar_client-0.6.1 lib/stellar_client/responses/send_payment_response.rb
stellar_client-0.6.0 lib/stellar_client/responses/send_payment_response.rb
stellar_client-0.5.2 lib/stellar_client/responses/send_payment_response.rb
stellar_client-0.5.1 lib/stellar_client/responses/send_payment_response.rb
stellar_client-0.5.0 lib/stellar_client/responses/send_payment_response.rb