Class: Unit::Account::Credit::BalanceHistoryRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/account/credit/balance_history_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(limit = BALANCE_HISTORY_LIMIT, offset = BALANCE_HISTORY_OFFSET, account_id = nil, customer_id = nil, since = nil, _until = nil) ⇒ BalanceHistoryRequest

Returns a new instance of BalanceHistoryRequest.

Parameters:

  • limit (Integer) (defaults to: BALANCE_HISTORY_LIMIT)
    • optional

  • offset (Integer) (defaults to: BALANCE_HISTORY_OFFSET)
    • optional

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

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

  • since (String) (defaults to: nil)
    • optional

  • _until (String) (defaults to: nil)
    • optional



17
18
19
20
21
22
23
24
25
# File 'lib/unit/models/account/credit/balance_history_request.rb', line 17

def initialize(limit = BALANCE_HISTORY_LIMIT, offset = BALANCE_HISTORY_OFFSET,  = nil, customer_id = nil,
               since = nil, _until = nil)
  @limit = limit
  @offset = offset
  @account_id = 
  @customer_id = customer_id
  @since = since
  @_until = _until
end

Instance Attribute Details

#_untilObject (readonly)

Returns the value of attribute _until.



9
10
11
# File 'lib/unit/models/account/credit/balance_history_request.rb', line 9

def _until
  @_until
end

#account_idObject (readonly)

Returns the value of attribute account_id.



9
10
11
# File 'lib/unit/models/account/credit/balance_history_request.rb', line 9

def 
  @account_id
end

#customer_idObject (readonly)

Returns the value of attribute customer_id.



9
10
11
# File 'lib/unit/models/account/credit/balance_history_request.rb', line 9

def customer_id
  @customer_id
end

#limitObject (readonly)

Returns the value of attribute limit.



9
10
11
# File 'lib/unit/models/account/credit/balance_history_request.rb', line 9

def limit
  @limit
end

#offsetObject (readonly)

Returns the value of attribute offset.



9
10
11
# File 'lib/unit/models/account/credit/balance_history_request.rb', line 9

def offset
  @offset
end

#sinceObject (readonly)

Returns the value of attribute since.



9
10
11
# File 'lib/unit/models/account/credit/balance_history_request.rb', line 9

def since
  @since
end

Instance Method Details

#to_hashObject



27
28
29
30
31
32
33
34
35
# File 'lib/unit/models/account/credit/balance_history_request.rb', line 27

def to_hash
  params = { "page[limit]": limit,
             "page[offset]": offset,
             "filter[accountId]": ,
             "filter[customerId]": customer_id,
             "filter[since]": since,
             "filter[until]": _until }
  params.compact
end