Class: Atm

Inherits:
Object
  • Object
show all
Defined in:
lib/capital_one/atm.rb

Class Method Summary collapse

Class Method Details

.apiKeyObject


11
12
13
# File 'lib/capital_one/atm.rb', line 11

def self.apiKey
	return Config.apiKey
end

.getAllObject

*** GET ***

getAll

Returns all ATMs as an array of hashes.


19
20
21
22
23
# File 'lib/capital_one/atm.rb', line 19

def self.getAll
	url = "#{self.urlWithEntity}?key=#{self.apiKey}"
	resp = Net::HTTP.get_response(URI.parse(url))
	data = JSON.parse(resp.body)
end

.getOne(id) ⇒ Object

getOne

Parameters: ATMid Returns the ATM that has the given ID.


28
29
30
31
32
# File 'lib/capital_one/atm.rb', line 28

def self.getOne(id)
	url = "#{self.urlWithEntity}/#{id}?key=#{self.apiKey}"
	resp = Net::HTTP.get_response(URI.parse(url))
	data = JSON.parse(resp.body)
end

.urlObject


7
8
9
# File 'lib/capital_one/atm.rb', line 7

def self.url
	return Config.baseUrl
end

.urlWithEntityObject


3
4
5
# File 'lib/capital_one/atm.rb', line 3

def self.urlWithEntity
	return Config.baseUrl + "/atms"
end