Sha256: a91c1190e2c51df02f33fae8cbac6f1789f53d66d59b7d7fce7eaa78a9ecae1c

Contents?: true

Size: 558 Bytes

Versions: 2

Compression:

Stored size: 558 Bytes

Contents

module Stellar
  class PaymentOp

    def self.native(amount)
      currency = Stellar::Currency.native
      with_currency(currency).tap do |result|
        result.amount   = amount
      end
    end

    def self.iso4217(code, issuer, amount)
      currency = Stellar::Currency.iso4217(code, issuer)
      with_currency(currency).tap do |result|
        result.amount   = amount
      end
    end

    def self.with_currency(currency)
      new.tap do |result|
        result.currency = currency
      end
    end

    def apply_defaults
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stellar-base-0.0.9 lib/stellar/payment_op.rb
stellar-base-0.0.8 lib/stellar/payment_op.rb