Class: Unit::AtmLocation::ListByAddressParams

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/atm_location/list_by_address_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, search_radius = nil) ⇒ ListByAddressParams

Returns a new instance of ListByAddressParams.

Parameters:

  • address (Address)
  • search_radius (Integer) (defaults to: nil)


12
13
14
15
# File 'lib/unit/models/atm_location/list_by_address_params.rb', line 12

def initialize(address, search_radius = nil)
  @address = address
  @search_radius = search_radius
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



8
9
10
# File 'lib/unit/models/atm_location/list_by_address_params.rb', line 8

def address
  @address
end

#search_radiusObject (readonly)

Returns the value of attribute search_radius.



8
9
10
# File 'lib/unit/models/atm_location/list_by_address_params.rb', line 8

def search_radius
  @search_radius
end

Instance Method Details

#to_hashObject



17
18
19
20
21
22
23
# File 'lib/unit/models/atm_location/list_by_address_params.rb', line 17

def to_hash
  params = {
    "filter[address]": address.represent.to_json,
    "filter[searchRadius]": search_radius
  }
  params.compact
end