Class: Unit::Account::Credit::ListAccountParams
- Inherits:
-
Object
- Object
- Unit::Account::Credit::ListAccountParams
- Defined in:
- lib/unit/models/account/credit/list_account_params.rb
Instance Attribute Summary collapse
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#from_balance ⇒ Object
readonly
Returns the value of attribute from_balance.
-
#include ⇒ Object
readonly
Returns the value of attribute include.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#to_balance ⇒ Object
readonly
Returns the value of attribute to_balance.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(limit = ACCOUNT_LIST_LIMIT, offset = ACCOUNT_LIST_OFFSET, customer_id = nil, tags = nil, status = nil, from_balance = nil, to_balance = nil, include = nil, type = nil) ⇒ ListAccountParams
constructor
A new instance of ListAccountParams.
- #to_hash ⇒ Object
Constructor Details
#initialize(limit = ACCOUNT_LIST_LIMIT, offset = ACCOUNT_LIST_OFFSET, customer_id = nil, tags = nil, status = nil, from_balance = nil, to_balance = nil, include = nil, type = nil) ⇒ ListAccountParams
Returns a new instance of ListAccountParams.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/unit/models/account/credit/list_account_params.rb', line 21 def initialize(limit = ACCOUNT_LIST_LIMIT, offset = ACCOUNT_LIST_OFFSET, customer_id = nil, = nil, status = nil, from_balance = nil, to_balance = nil, include = nil, type = nil) @limit = limit @offset = offset @customer_id = customer_id @tags = @status = status @from_balance = from_balance @to_balance = to_balance @include = include @type = type end |
Instance Attribute Details
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
9 10 11 |
# File 'lib/unit/models/account/credit/list_account_params.rb', line 9 def customer_id @customer_id end |
#from_balance ⇒ Object (readonly)
Returns the value of attribute from_balance.
9 10 11 |
# File 'lib/unit/models/account/credit/list_account_params.rb', line 9 def from_balance @from_balance end |
#include ⇒ Object (readonly)
Returns the value of attribute include.
9 10 11 |
# File 'lib/unit/models/account/credit/list_account_params.rb', line 9 def include @include end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
9 10 11 |
# File 'lib/unit/models/account/credit/list_account_params.rb', line 9 def limit @limit end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
9 10 11 |
# File 'lib/unit/models/account/credit/list_account_params.rb', line 9 def offset @offset end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
9 10 11 |
# File 'lib/unit/models/account/credit/list_account_params.rb', line 9 def status @status end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
9 10 11 |
# File 'lib/unit/models/account/credit/list_account_params.rb', line 9 def @tags end |
#to_balance ⇒ Object (readonly)
Returns the value of attribute to_balance.
9 10 11 |
# File 'lib/unit/models/account/credit/list_account_params.rb', line 9 def to_balance @to_balance end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/unit/models/account/credit/list_account_params.rb', line 9 def type @type end |
Instance Method Details
#to_hash ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/unit/models/account/credit/list_account_params.rb', line 34 def to_hash params = { "page[limit]": limit, "page[offset]": offset, "filter[customerId]": customer_id, "filter[tags]": , "filter[fromBalance]": from_balance, "filter[toBalance]": to_balance, "filter[type]": type, "include": include&.join(",") } status&.each_with_index&.map do |val, index| params.merge!({ "filter[status][#{index}]": val }) end params.compact end |