Class: Documents::Statements::Statement
- Inherits:
-
Object
- Object
- Documents::Statements::Statement
- Defined in:
- lib/ynab_convert/documents/statements/statement.rb
Overview
The base Statement class from which other Statements inherit. Represents a CSV statement from a financial institution, typically from its online banking portal.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#csv_import_options ⇒ Object
readonly
Returns the value of attribute csv_import_options.
-
#filepath ⇒ Object
readonly
Returns the value of attribute filepath.
Instance Method Summary collapse
-
#initialize(filepath:, csv_import_options: CSV::DEFAULT_OPTIONS) ⇒ Statement
constructor
A new instance of Statement.
- #institution_name ⇒ Object
Constructor Details
#initialize(filepath:, csv_import_options: CSV::DEFAULT_OPTIONS) ⇒ Statement
Returns a new instance of Statement.
15 16 17 18 19 20 21 22 |
# File 'lib/ynab_convert/documents/statements/statement.rb', line 15 def initialize(filepath:, csv_import_options: CSV::DEFAULT_OPTIONS) validate(filepath) = CSV::DEFAULT_OPTIONS.merge(converters: %i[numeric date]) @filepath = filepath @csv_import_options = .merge() end |
Instance Attribute Details
#csv_import_options ⇒ Object (readonly)
Returns the value of attribute csv_import_options.
9 10 11 |
# File 'lib/ynab_convert/documents/statements/statement.rb', line 9 def @csv_import_options end |
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
9 10 11 |
# File 'lib/ynab_convert/documents/statements/statement.rb', line 9 def filepath @filepath end |
Instance Method Details
#institution_name ⇒ Object
24 25 26 |
# File 'lib/ynab_convert/documents/statements/statement.rb', line 24 def institution_name self.class.name.split('::').last end |