Class: Cuker::AbstractFile
- Inherits:
-
Object
- Object
- Cuker::AbstractFile
- Includes:
- LoggerSetup
- Defined in:
- lib/cuker/helpers/writers/abstract_writer.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#rows ⇒ Object
Returns the value of attribute rows.
Attributes included from LoggerSetup
Instance Method Summary collapse
- #add_row(ary) ⇒ Object (also: #add_line)
- #current_row ⇒ Object
- #finishup ⇒ Object
-
#initialize(name) ⇒ AbstractFile
constructor
A new instance of AbstractFile.
-
#read_rows ⇒ Object
Ary of rows.
Methods included from LoggerSetup
#init_logger, reset_appender_log_levels
Constructor Details
#initialize(name) ⇒ AbstractFile
Returns a new instance of AbstractFile.
87 88 89 90 91 |
# File 'lib/cuker/helpers/writers/abstract_writer.rb', line 87 def initialize name init_logger @name = name @rows = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
85 86 87 |
# File 'lib/cuker/helpers/writers/abstract_writer.rb', line 85 def name @name end |
#rows ⇒ Object
Returns the value of attribute rows.
85 86 87 |
# File 'lib/cuker/helpers/writers/abstract_writer.rb', line 85 def rows @rows end |
Instance Method Details
#add_row(ary) ⇒ Object Also known as: add_line
97 98 99 |
# File 'lib/cuker/helpers/writers/abstract_writer.rb', line 97 def add_row ary @rows << ary end |
#current_row ⇒ Object
93 94 95 |
# File 'lib/cuker/helpers/writers/abstract_writer.rb', line 93 def current_row @rows.size + 1 end |
#finishup ⇒ Object
108 109 110 |
# File 'lib/cuker/helpers/writers/abstract_writer.rb', line 108 def finishup @log.debug "closing up #{@name} file if needed" end |
#read_rows ⇒ Object
Returns ary of rows.
104 105 106 |
# File 'lib/cuker/helpers/writers/abstract_writer.rb', line 104 def read_rows @rows end |