Class: Unit::CashDeposit::ListByCoordinatesParams

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(coordinates, limit = CASH_DEPOSIT_LIMIT, offset = CASH_DEPOSIT_OFFSET, service_type = nil) ⇒ ListByCoordinatesParams

Returns a new instance of ListByCoordinatesParams.

Parameters:

  • coordinates (Coordinates)
  • 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_coordinates_params.rb', line 14

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

Instance Attribute Details

#coordinatesObject (readonly)

Returns the value of attribute coordinates.



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

def coordinates
  @coordinates
end

#limitObject (readonly)

Returns the value of attribute limit.



8
9
10
# File 'lib/unit/models/cash_deposit/list_by_coordinates_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_coordinates_params.rb', line 8

def offset
  @offset
end

#service_typeObject (readonly)

Returns the value of attribute service_type.



8
9
10
# File 'lib/unit/models/cash_deposit/list_by_coordinates_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_coordinates_params.rb', line 22

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