Class: IbanCalculator::Bank

Inherits:
Object
  • Object
show all
Defined in:
lib/iban_calculator/bank.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Bank

Returns a new instance of Bank.



5
6
7
8
9
10
11
12
13
# File 'lib/iban_calculator/bank.rb', line 5

def initialize(attributes = {})
  self.code = attributes[:code]
  self.name = attributes[:name]
  self.country = attributes[:country]
  self.address = attributes[:address]
  self.url = attributes[:url]
  self.branch = attributes[:branch]
  self.branch_code = attributes[:branch_code]
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



3
4
5
# File 'lib/iban_calculator/bank.rb', line 3

def address
  @address
end

#branchObject

Returns the value of attribute branch.



3
4
5
# File 'lib/iban_calculator/bank.rb', line 3

def branch
  @branch
end

#branch_codeObject

Returns the value of attribute branch_code.



3
4
5
# File 'lib/iban_calculator/bank.rb', line 3

def branch_code
  @branch_code
end

#codeObject

Returns the value of attribute code.



3
4
5
# File 'lib/iban_calculator/bank.rb', line 3

def code
  @code
end

#countryObject

Returns the value of attribute country.



3
4
5
# File 'lib/iban_calculator/bank.rb', line 3

def country
  @country
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/iban_calculator/bank.rb', line 3

def name
  @name
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/iban_calculator/bank.rb', line 3

def url
  @url
end

Instance Method Details

#as_json(opts = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/iban_calculator/bank.rb', line 15

def as_json(opts = {})
  {
    code: code,
    name: name,
    country: country,
    address: address,
    url: url,
    branch: branch,
    branch_code: branch_code,
  }
end