Class: Coopy::CsvTable

Inherits:
Object
  • Object
show all
Includes:
Table
Defined in:
lib/coopy/csv_table.rb

Instance Attribute Summary

Attributes included from Table

#height, #width

Instance Method Summary collapse

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

#clearObject



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_viewObject



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

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


38
39
40
# File 'lib/coopy/csv_table.rb', line 38

def insert_or_delete_rows(fate, hfate) 
  raise NotImplementedError
end

#is_resizable?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/coopy/csv_table.rb', line 26

def is_resizable? 
  false
end

#resize(w, h) ⇒ Object

Raises:

  • (NotImplementedError)


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_blankObject

Raises:

  • (NotImplementedError)


46
47
48
# File 'lib/coopy/csv_table.rb', line 46

def trim_blank 
  raise NotImplementedError
end