Class: Coopy::CsvTable
Instance Attribute Summary
Attributes included from Table
Instance Method Summary collapse
- #clear ⇒ Object
- #get_cell(x, y) ⇒ Object
- #get_cell_view ⇒ Object
-
#initialize(csv) ⇒ CsvTable
constructor
A new instance of CsvTable.
- #insert_or_delete_columns(fate, wfate) ⇒ Object
- #insert_or_delete_rows(fate, hfate) ⇒ Object
- #is_resizable? ⇒ Boolean
- #resize(w, h) ⇒ Object
- #set_cell(x, y, cell) ⇒ Object
- #trim_blank ⇒ Object
Constructor Details
#initialize(csv) ⇒ CsvTable
Returns a new instance of CsvTable.
8 9 10 11 12 |
# File 'lib/coopy/csv_table.rb', line 8 def initialize(csv) @csv = csv @height = csv.size @width = csv[0].size end |
Instance Method Details
#clear ⇒ Object
34 35 36 |
# File 'lib/coopy/csv_table.rb', line 34 def clear @csv = [] end |
#get_cell(x, y) ⇒ Object
14 15 16 |
# File 'lib/coopy/csv_table.rb', line 14 def get_cell(x, y) @csv[y][x] end |
#get_cell_view ⇒ Object
22 23 24 |
# File 'lib/coopy/csv_table.rb', line 22 def get_cell_view Coopy::SimpleView.new end |
#insert_or_delete_columns(fate, wfate) ⇒ Object
42 43 44 |
# File 'lib/coopy/csv_table.rb', line 42 def insert_or_delete_columns(fate, wfate) raise NotImplementedError end |
#insert_or_delete_rows(fate, hfate) ⇒ Object
38 39 40 |
# File 'lib/coopy/csv_table.rb', line 38 def insert_or_delete_rows(fate, hfate) raise NotImplementedError end |
#is_resizable? ⇒ Boolean
26 27 28 |
# File 'lib/coopy/csv_table.rb', line 26 def is_resizable? false end |
#resize(w, h) ⇒ Object
30 31 32 |
# File 'lib/coopy/csv_table.rb', line 30 def resize(w, h) raise NotImplementedError end |
#set_cell(x, y, cell) ⇒ Object
18 19 20 |
# File 'lib/coopy/csv_table.rb', line 18 def set_cell(x, y, cell) @csv[y][x] = cell end |
#trim_blank ⇒ Object
46 47 48 |
# File 'lib/coopy/csv_table.rb', line 46 def trim_blank raise NotImplementedError end |