Class: Unit::AtmLocation

Inherits:
APIResource show all
Includes:
ResourceOperations::List
Defined in:
lib/unit-ruby/atm_location.rb

Instance Attribute Summary

Attributes inherited from APIResource

#id, #raw_data, #relationships, #type

Class Method Summary collapse

Methods included from ResourceOperations::List

included

Methods inherited from APIResource

#as_json_api, attribute, #attributes, belongs_to, build_resource_from_json_api, #clear_attributes!, connection, #dirty?, #dirty_attributes, has_many, #initialize, #mark_as_clean!, #mark_attribute_as_dirty, path, resource_path, #resource_type, resources_path, #schema, schema, #update_attribute, #update_resource_from_json_api

Constructor Details

This class inherits a constructor from Unit::APIResource

Class Method Details

.list_by_address(address:, search_radius:) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/unit-ruby/atm_location.rb', line 32

def self.list_by_address(address:, search_radius:)
  list(
    where: {
      postal_code: address,
      searchRadius: search_radius
    }
  )
end

.list_by_coordinates(latitude:, longitude:, search_radius:) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/unit-ruby/atm_location.rb', line 14

def self.list_by_coordinates(latitude:, longitude:, search_radius:)
  list(
    where: {
      coordinates: { longitude: longitude, latitude: latitude }.to_json,
      searchRadius: search_radius
    }
  )
end

.list_by_postal_code(postal_code:, search_radius:) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/unit-ruby/atm_location.rb', line 23

def self.list_by_postal_code(postal_code:, search_radius:)
  list(
    where: {
      postal_code: postal_code,
      searchRadius: search_radius
    }
  )
end