Class: AbaNumbers::Database::Row
- Inherits:
-
Object
- Object
- AbaNumbers::Database::Row
- Includes:
- Comparable
- Defined in:
- lib/aba_numbers/database.rb
Instance Attribute Summary collapse
-
#aba_number ⇒ Object
readonly
Returns the value of attribute aba_number.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#short_name ⇒ Object
readonly
Returns the value of attribute short_name.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #funds_transfer ⇒ Object
-
#initialize(line) ⇒ Row
constructor
A new instance of Row.
- #last_updated ⇒ Object
- #securities ⇒ Object
- #settlement_only ⇒ Object
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(line) ⇒ Row
Returns a new instance of Row.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/aba_numbers/database.rb', line 17 def initialize(line) @aba_number = line[0, 9] @short_name = line[9, 18].strip @name = line[27, 36].strip @state = line[63, 2] @city = line[65, 25].strip @funds_transfer = line[90, 1] @settlement_only = line[91, 1] @securities = line[92, 1] @last_updated = line[93, 8].strip end |
Instance Attribute Details
#aba_number ⇒ Object (readonly)
Returns the value of attribute aba_number.
15 16 17 |
# File 'lib/aba_numbers/database.rb', line 15 def aba_number @aba_number end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
15 16 17 |
# File 'lib/aba_numbers/database.rb', line 15 def city @city end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/aba_numbers/database.rb', line 15 def name @name end |
#short_name ⇒ Object (readonly)
Returns the value of attribute short_name.
15 16 17 |
# File 'lib/aba_numbers/database.rb', line 15 def short_name @short_name end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
15 16 17 |
# File 'lib/aba_numbers/database.rb', line 15 def state @state end |
Instance Method Details
#<=>(other) ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/aba_numbers/database.rb', line 56 def <=>(other) if other.respond_to? :aba_number aba_number <=> other.aba_number else to_s <=> other.to_s end end |
#funds_transfer ⇒ Object
29 30 31 |
# File 'lib/aba_numbers/database.rb', line 29 def funds_transfer @funds_transfer == 'Y' end |
#last_updated ⇒ Object
41 42 43 44 |
# File 'lib/aba_numbers/database.rb', line 41 def last_updated return nil if @last_updated.empty? Date.new @last_updated[0, 4].to_i, @last_updated[4, 2].to_i, @last_updated[6, 2].to_i end |
#securities ⇒ Object
37 38 39 |
# File 'lib/aba_numbers/database.rb', line 37 def securities @securities == 'Y' end |
#settlement_only ⇒ Object
33 34 35 |
# File 'lib/aba_numbers/database.rb', line 33 def settlement_only @settlement_only == 'S' end |
#to_s ⇒ Object Also known as: inspect
46 47 48 49 50 51 52 |
# File 'lib/aba_numbers/database.rb', line 46 def to_s "#<AbaNumbers::Database::Row aba_number=#{aba_number.inspect} " + "short_name=#{short_name.inspect} name=#{name.inspect} " + "state=#{state.inspect} city=#{city.inspect} " + "funds_transfer=#{funds_transfer.inspect} settlement_only=#{settlement_only.inspect} " + "securities=#{securities.inspect} last_updated=#{last_updated}>" end |