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.
14 15 16 |
# File 'lib/roo/csv.rb', line 14 def filename @filename end |
Instance Method Details
#cell(row, col, sheet = nil) ⇒ Object
22 23 24 25 26 |
# File 'lib/roo/csv.rb', line 22 def cell(row, col, sheet = nil) sheet ||= default_sheet read_cells(sheet) @cell[normalize(row, col)] end |
#cell_postprocessing(_row, _col, value) ⇒ Object
34 35 36 |
# File 'lib/roo/csv.rb', line 34 def cell_postprocessing(_row, _col, value) value end |
#celltype(row, col, sheet = nil) ⇒ Object
28 29 30 31 32 |
# File 'lib/roo/csv.rb', line 28 def celltype(row, col, sheet = nil) sheet ||= default_sheet read_cells(sheet) @cell_type[normalize(row, col)] end |
#csv_options ⇒ Object
38 39 40 |
# File 'lib/roo/csv.rb', line 38 def @options[:csv_options] || {} end |
#set_type(row, col, type, _sheet) ⇒ Object
46 47 48 |
# File 'lib/roo/csv.rb', line 46 def set_type(row, col, type, _sheet) @cell_type[[row, col]] = type end |
#set_value(row, col, value, _sheet) ⇒ Object
42 43 44 |
# File 'lib/roo/csv.rb', line 42 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.
18 19 20 |
# File 'lib/roo/csv.rb', line 18 def sheets ["default"] end |