Class: Unit::Customer::ListCustomerParams
- Inherits:
-
Object
- Object
- Unit::Customer::ListCustomerParams
- Defined in:
- lib/unit/models/customer/list_customer_params.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#sort ⇒ Object
readonly
Returns the value of attribute sort.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(limit = CUSTOMER_LIST_LIMIT, offset = CUSTOMER_LIST_OFFSET, query = nil, email = nil, tags = nil, status = nil, sort = nil) ⇒ ListCustomerParams
constructor
A new instance of ListCustomerParams.
- #to_hash ⇒ Object
Constructor Details
#initialize(limit = CUSTOMER_LIST_LIMIT, offset = CUSTOMER_LIST_OFFSET, query = nil, email = nil, tags = nil, status = nil, sort = nil) ⇒ ListCustomerParams
Returns a new instance of ListCustomerParams.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/unit/models/customer/list_customer_params.rb', line 17 def initialize(limit = CUSTOMER_LIST_LIMIT, offset = CUSTOMER_LIST_OFFSET, query = nil, email = nil, = nil, status = nil, sort = nil) @limit = limit @offset = offset @query = query @email = email @tags = @status = status @sort = sort end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
8 9 10 |
# File 'lib/unit/models/customer/list_customer_params.rb', line 8 def email @email end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
8 9 10 |
# File 'lib/unit/models/customer/list_customer_params.rb', line 8 def limit @limit end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
8 9 10 |
# File 'lib/unit/models/customer/list_customer_params.rb', line 8 def offset @offset end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
8 9 10 |
# File 'lib/unit/models/customer/list_customer_params.rb', line 8 def query @query end |
#sort ⇒ Object (readonly)
Returns the value of attribute sort.
8 9 10 |
# File 'lib/unit/models/customer/list_customer_params.rb', line 8 def sort @sort end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/unit/models/customer/list_customer_params.rb', line 8 def status @status end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/customer/list_customer_params.rb', line 8 def @tags end |
Instance Method Details
#to_hash ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/unit/models/customer/list_customer_params.rb', line 28 def to_hash params = { "page[limit]": limit, "page[offset]": offset, "filter[query]": query, "filter[email]": email, "filter[tags]": , "sort": sort } status&.each_with_index&.map do |val, index| params.merge!({ "filter[status][#{index}]": val }) end params.compact end |