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(code, name, kana, hira, roma) ⇒ Bank

Returns a new instance of Bank.



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

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

Instance Attribute Details

#branchesObject (readonly)

Returns the value of attribute branches.



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

def branches
  @branches
end

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#kanaObject (readonly)

Returns the value of attribute kana.



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

def kana
  @kana
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#romaObject (readonly)

Returns the value of attribute roma.



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

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