Class: ZenginLite::Branch
- Inherits:
-
Object
- Object
- ZenginLite::Branch
- Defined in:
- lib/zengin_lite/branch.rb
Instance Attribute Summary collapse
-
#bank_code ⇒ Object
readonly
Returns the value of attribute bank_code.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#hira ⇒ Object
readonly
Returns the value of attribute hira.
-
#kana ⇒ Object
readonly
Returns the value of attribute kana.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#roma ⇒ Object
readonly
Returns the value of attribute roma.
Class Method Summary collapse
- .from_row(row) ⇒ Object private
Instance Method Summary collapse
- #bank ⇒ Object
-
#initialize(code:, bank_code:, name:, kana:, hira:, roma:) ⇒ Branch
constructor
A new instance of Branch.
- #inspect ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(code:, bank_code:, name:, kana:, hira:, roma:) ⇒ Branch
Returns a new instance of Branch.
9 10 11 12 13 14 15 16 |
# File 'lib/zengin_lite/branch.rb', line 9 def initialize(code:, bank_code:, name:, kana:, hira:, roma:) @code = code @bank_code = bank_code @name = name @kana = kana @hira = hira @roma = roma end |
Instance Attribute Details
#bank_code ⇒ Object (readonly)
Returns the value of attribute bank_code.
3 4 5 |
# File 'lib/zengin_lite/branch.rb', line 3 def bank_code @bank_code end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/zengin_lite/branch.rb', line 3 def code @code end |
#hira ⇒ Object (readonly)
Returns the value of attribute hira.
3 4 5 |
# File 'lib/zengin_lite/branch.rb', line 3 def hira @hira end |
#kana ⇒ Object (readonly)
Returns the value of attribute kana.
3 4 5 |
# File 'lib/zengin_lite/branch.rb', line 3 def kana @kana end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/zengin_lite/branch.rb', line 3 def name @name end |
#roma ⇒ Object (readonly)
Returns the value of attribute roma.
3 4 5 |
# File 'lib/zengin_lite/branch.rb', line 3 def roma @roma end |
Class Method Details
.from_row(row) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/zengin_lite/branch.rb', line 34 def self.from_row(row) return nil unless row new( code: row[0], bank_code: row[1], name: row[2], kana: row[3], hira: row[4], roma: row[5] ) end |
Instance Method Details
#bank ⇒ Object
5 6 7 |
# File 'lib/zengin_lite/branch.rb', line 5 def bank ZenginLite.bank(bank_code) end |
#inspect ⇒ Object
29 30 31 |
# File 'lib/zengin_lite/branch.rb', line 29 def inspect "#<#{self.class.name} code=#{code.inspect}, bank_code=#{bank_code.inspect}, name=#{name.inspect}, kana=#{kana.inspect}>" end |
#to_h ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/zengin_lite/branch.rb', line 18 def to_h { code: code, bank_code: bank_code, name: name, kana: kana, hira: hira, roma: roma } end |