class Atm
Public Class Methods
apiKey()
click to toggle source
# File lib/capital_one/atm.rb, line 11 def self.apiKey return Config.apiKey end
getAll()
click to toggle source
getAllByLocation(lat, lng, rad)
click to toggle source
getAllByLocation¶ ↑
Get all ATMs withing a certain radius of a geocoordinate
Paremeters: latitude, longitude, radius¶ ↑
Accepts lat, lng, and rad as floats Returns an array of hashes within the radius of the geocoordinate. Each hash has an ATM.
# File lib/capital_one/atm.rb, line 32 def self.getAllByLocation(lat, lng, rad) url = "#{self.urlWithEntity}?lat=#{lat}&lng=#{lng}&rad=#{rad}&key=#{self.apiKey}" resp = Net::HTTP.get_response(URI.parse(url)) data = JSON.parse(resp.body) end
getOne(id)
click to toggle source
url()
click to toggle source
# File lib/capital_one/atm.rb, line 7 def self.url return Config.baseUrl end
urlWithEntity()
click to toggle source
# File lib/capital_one/atm.rb, line 3 def self.urlWithEntity return Config.baseUrl + "/atms" end