Class: Unit::AtmLocation::ListByPostalCodeParams

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(postal_code, search_radius = nil) ⇒ ListByPostalCodeParams

Returns a new instance of ListByPostalCodeParams.

Parameters:

  • postal_code (String)
  • search_radius (Integer) (defaults to: nil)


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

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

Instance Attribute Details

#postal_codeObject (readonly)

Returns the value of attribute postal_code.



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

def postal_code
  @postal_code
end

#search_radiusObject (readonly)

Returns the value of attribute search_radius.



8
9
10
# File 'lib/unit/models/atm_location/list_by_postal_code_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_postal_code_params.rb', line 17

def to_hash
  params = {
    "filter[postalCode]": postal_code,
    "filter[searchRadius]": search_radius
  }
  params.compact
end