Class: Unit::Transaction::GetTransactionParams

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/transaction/get_transaction_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transaction_id, account_id, customer_id = nil, include = nil) ⇒ GetTransactionParams

Returns a new instance of GetTransactionParams.

Parameters:

  • transaction_id (String)
  • account_id (String)
  • customer_id (String) (defaults to: nil)
    • optional

  • include (Array<String>) (defaults to: nil)
    • optional



14
15
16
17
18
19
# File 'lib/unit/models/transaction/get_transaction_params.rb', line 14

def initialize(transaction_id, , customer_id = nil, include = nil)
  @transaction_id = transaction_id
  @account_id = 
  @customer_id = customer_id
  @include = include
end

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



8
9
10
# File 'lib/unit/models/transaction/get_transaction_params.rb', line 8

def 
  @account_id
end

#customer_idObject

Returns the value of attribute customer_id.



8
9
10
# File 'lib/unit/models/transaction/get_transaction_params.rb', line 8

def customer_id
  @customer_id
end

#includeObject

Returns the value of attribute include.



8
9
10
# File 'lib/unit/models/transaction/get_transaction_params.rb', line 8

def include
  @include
end

#transaction_idObject

Returns the value of attribute transaction_id.



8
9
10
# File 'lib/unit/models/transaction/get_transaction_params.rb', line 8

def transaction_id
  @transaction_id
end

Instance Method Details

#to_hashObject



21
22
23
24
25
# File 'lib/unit/models/transaction/get_transaction_params.rb', line 21

def to_hash
  params = { "filter[customerId]": customer_id,
             "include": include&.join(",") }
  params.compact
end