Class: Unit::CashDeposit::ListByPostalCodeParams

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/cash_deposit/list_by_postal_code_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(postal_code, limit = CASH_DEPOSIT_LIMIT, offset = CASH_DEPOSIT_OFFSET, service_type = nil) ⇒ ListByPostalCodeParams

Returns a new instance of ListByPostalCodeParams.

Parameters:

  • postal_code (String)
  • limit (Integer) (defaults to: CASH_DEPOSIT_LIMIT)
    • optional

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

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



14
15
16
17
18
19
20
# File 'lib/unit/models/cash_deposit/list_by_postal_code_params.rb', line 14

def initialize(postal_code, limit = CASH_DEPOSIT_LIMIT, offset = CASH_DEPOSIT_OFFSET,
               service_type = nil)
  @limit = limit
  @offset = offset
  @postal_code = postal_code
  @service_type = service_type
end

Instance Attribute Details

#limitObject (readonly)

Returns the value of attribute limit.



8
9
10
# File 'lib/unit/models/cash_deposit/list_by_postal_code_params.rb', line 8

def limit
  @limit
end

#offsetObject (readonly)

Returns the value of attribute offset.



8
9
10
# File 'lib/unit/models/cash_deposit/list_by_postal_code_params.rb', line 8

def offset
  @offset
end

#postal_codeObject (readonly)

Returns the value of attribute postal_code.



8
9
10
# File 'lib/unit/models/cash_deposit/list_by_postal_code_params.rb', line 8

def postal_code
  @postal_code
end

#service_typeObject (readonly)

Returns the value of attribute service_type.



8
9
10
# File 'lib/unit/models/cash_deposit/list_by_postal_code_params.rb', line 8

def service_type
  @service_type
end

Instance Method Details

#to_hashObject



22
23
24
25
26
27
28
29
30
# File 'lib/unit/models/cash_deposit/list_by_postal_code_params.rb', line 22

def to_hash
  params = {
    "page[limit]": limit,
    "page[offset]": offset,
    "filter[postalCode]": postal_code,
    "filter[serviceType]": service_type
  }
  params.compact
end