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

*** GET ***

getAll

Get all the branches Returns an array of hashes. Each hash is a branch.


19
20
21
22
23
24
# File 'lib/capital_one/branch.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

Get a branch by it's id Parameters: BranchId Returns a hash with the specified branch.


29
30
31
32
33
34
# File 'lib/capital_one/branch.rb', line 29

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