Class: ZenginCode::Bank

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Bank

Returns a new instance of Bank.



20
21
22
23
24
25
26
27
28
# File 'lib/zengin_code/bank.rb', line 20

def initialize(options = {})
  @code = options['code']
  @name = options['name']
  @kana = options['kana']
  @hira = options['hira']
  @roma = options['roma']
  @branches = {}
  self.class[code] = self
end

Instance Attribute Details

#branchesObject (readonly)

Returns the value of attribute branches.



29
30
31
# File 'lib/zengin_code/bank.rb', line 29

def branches
  @branches
end

#codeObject (readonly)

Returns the value of attribute code.



29
30
31
# File 'lib/zengin_code/bank.rb', line 29

def code
  @code
end

#hiraObject (readonly)

Returns the value of attribute hira.



29
30
31
# File 'lib/zengin_code/bank.rb', line 29

def hira
  @hira
end

#kanaObject (readonly)

Returns the value of attribute kana.



29
30
31
# File 'lib/zengin_code/bank.rb', line 29

def kana
  @kana
end

#nameObject (readonly)

Returns the value of attribute name.



29
30
31
# File 'lib/zengin_code/bank.rb', line 29

def name
  @name
end

#romaObject (readonly)

Returns the value of attribute roma.



29
30
31
# File 'lib/zengin_code/bank.rb', line 29

def roma
  @roma
end

Class Method Details

.[](code) ⇒ Object



7
8
9
# File 'lib/zengin_code/bank.rb', line 7

def [](code)
  @banks[code]
end

.[]=(code, bank) ⇒ Object



11
12
13
# File 'lib/zengin_code/bank.rb', line 11

def []=(code, bank)
  @banks[code] = bank
end

.allObject



15
16
17
# File 'lib/zengin_code/bank.rb', line 15

def all
  @banks
end