Class: Wice::Spreadsheet

Inherits:
Object show all
Defined in:
lib/wice/wice_grid_spreadsheet.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, field_separator, encoding = nil) ⇒ Spreadsheet

:nodoc:



9
10
11
12
13
# File 'lib/wice/wice_grid_spreadsheet.rb', line 9

def initialize(name, field_separator, encoding = nil)  #:nodoc:
  @tempfile = Tempfile.new(name)
  @tempfile.set_encoding(encoding) unless encoding.blank?
  @csv = CSV.new(@tempfile, col_sep: field_separator)
end

Instance Attribute Details

#tempfileObject (readonly)

:nodoc:



7
8
9
# File 'lib/wice/wice_grid_spreadsheet.rb', line 7

def tempfile
  @tempfile
end

Instance Method Details

#<<(row) ⇒ Object

:nodoc:



15
16
17
# File 'lib/wice/wice_grid_spreadsheet.rb', line 15

def << (row)  #:nodoc:
  @csv << row
end