Class: Branch

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

Class Method Summary collapse

Class Method Details

.apiKeyObject



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

def self.apiKey
  return Config.apiKey
end

.getAllObject

Gets all branches Returns an array of Hashes with the branch data



21
22
23
24
25
# File 'lib/capital_one/branch.rb', line 21

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

Gets one branch for a given ID

Parameters: AtmId

Returns a hash with the ATM data



32
33
34
35
36
# File 'lib/capital_one/branch.rb', line 32

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



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

def self.url
  return Config.baseUrl
end

.urlWithEntityObject



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

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