Class: Roo::CSV
Constant Summary
Constants inherited from Base
Base::MAX_ROW_COL, Base::MIN_ROW_COL
Instance Attribute Summary collapse
-
#filename ⇒ Object
(also: #filename_or_stream)
readonly
Returns the value of attribute filename.
Attributes inherited from Base
Instance Method Summary collapse
- #cell(row, col, sheet = nil) ⇒ Object
- #cell_postprocessing(_row, _col, value) ⇒ Object
- #celltype(row, col, sheet = nil) ⇒ Object
- #csv_options ⇒ Object
- #set_type(row, col, type, _sheet) ⇒ Object
- #set_value(row, col, value, _sheet) ⇒ Object
-
#sheets ⇒ Object
Returns an array with the names of the sheets.
Methods inherited from Base
TEMP_PREFIX, #cell_type_by_value, #close, #collect_last_row_col_for_sheet, #column, #default_sheet, #default_sheet=, #each, #each_with_pagename, #empty?, finalize, #find, #first_column_as_letter, #first_last_row_col_for_sheet, #info, #initialize, #inspect, #last_column_as_letter, #method_missing, #parse, #reload, #row, #row_with, #set, #sheet
Methods included from Formatters::YAML
Methods included from Formatters::XML
Methods included from Formatters::Matrix
Methods included from Formatters::CSV
Methods included from Formatters::Base
Constructor Details
This class inherits a constructor from Roo::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Roo::Base
Instance Attribute Details
#filename ⇒ Object (readonly) Also known as: filename_or_stream
Returns the value of attribute filename.
16 17 18 |
# File 'lib/roo/csv.rb', line 16 def filename @filename end |
Instance Method Details
#cell(row, col, sheet = nil) ⇒ Object
24 25 26 27 28 |
# File 'lib/roo/csv.rb', line 24 def cell(row, col, sheet = nil) sheet ||= default_sheet read_cells(sheet) @cell[normalize(row, col)] end |
#cell_postprocessing(_row, _col, value) ⇒ Object
36 37 38 |
# File 'lib/roo/csv.rb', line 36 def cell_postprocessing(_row, _col, value) value end |
#celltype(row, col, sheet = nil) ⇒ Object
30 31 32 33 34 |
# File 'lib/roo/csv.rb', line 30 def celltype(row, col, sheet = nil) sheet ||= default_sheet read_cells(sheet) @cell_type[normalize(row, col)] end |
#csv_options ⇒ Object
40 41 42 |
# File 'lib/roo/csv.rb', line 40 def @options[:csv_options] || {} end |
#set_type(row, col, type, _sheet) ⇒ Object
48 49 50 |
# File 'lib/roo/csv.rb', line 48 def set_type(row, col, type, _sheet) @cell_type[[row, col]] = type end |
#set_value(row, col, value, _sheet) ⇒ Object
44 45 46 |
# File 'lib/roo/csv.rb', line 44 def set_value(row, col, value, _sheet) @cell[[row, col]] = value end |
#sheets ⇒ Object
Returns an array with the names of the sheets. In CSV class there is only one dummy sheet, because a csv file cannot have more than one sheet.
20 21 22 |
# File 'lib/roo/csv.rb', line 20 def sheets ["default"] end |