Class: Round::TransactionCollection

Inherits:
Collection show all
Defined in:
lib/round/transaction.rb

Instance Attribute Summary

Attributes inherited from Collection

#collection

Attributes inherited from Base

#resource

Instance Method Summary collapse

Methods inherited from Collection

#[], #add, #initialize, #method_missing, #populate_data, #refresh

Methods inherited from Base

association, hash_identifier, #hash_identifier, #initialize, #method_missing, #refresh

Constructor Details

This class inherits a constructor from Round::Collection

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Round::Collection

Instance Method Details

#content_typeObject



39
40
41
# File 'lib/round/transaction.rb', line 39

def content_type
  Round::Transaction
end

#create(payees, confirmations = 6) ⇒ Object



43
44
45
46
47
48
49
50
51
52
# File 'lib/round/transaction.rb', line 43

def create(payees, confirmations = 6)
  raise 'Must have list of payees' unless payees

  payment_resource = @resource.create(
    utxo_confirmations: confirmations,
    payees: payees,
  )

  Round::Transaction.new(resource: payment_resource, client: @client)
end