Class: Cuker::AbstractFile

Inherits:
Object
  • Object
show all
Includes:
LoggerSetup
Defined in:
lib/cuker/helpers/writers/abstract_writer.rb

Direct Known Subclasses

CsvFile, JiraFile, RubyXLFile

Instance Attribute Summary collapse

Attributes included from LoggerSetup

#log

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



85
86
87
# File 'lib/cuker/helpers/writers/abstract_writer.rb', line 85

def name
  @name
end

#rowsObject

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_rowObject



93
94
95
# File 'lib/cuker/helpers/writers/abstract_writer.rb', line 93

def current_row
  @rows.size + 1
end

#finishupObject



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_rowsObject

Returns ary of rows.

Returns:

  • ary of rows



104
105
106
# File 'lib/cuker/helpers/writers/abstract_writer.rb', line 104

def read_rows
  @rows
end