Class: Coopy::JsonTable

Inherits:
Object
  • Object
show all
Defined in:
lib/lib/coopy/json_table.rb

Instance Method Summary collapse

Constructor Details

#initialize(data, name) ⇒ JsonTable

Returns a new instance of JsonTable.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/lib/coopy/json_table.rb', line 7

def initialize(data,name)
  @data = data
  @columns = Reflect.field(data,"columns")
  @rows = Reflect.field(data,"rows")
  @w = @columns.length
  @h = @rows.length
  @idx2col = {}
  begin
    _g1 = 0
    _g = @columns.length
    while(_g1 < _g) 
      idx = _g1
      _g1+=1
      begin
        v = @columns[idx]
        @idx2col[idx] = v
        v
      end
    end
  end
  @name = name
end

Instance Method Details

#alter_columns(columns) ⇒ Object



118
119
120
# File 'lib/lib/coopy/json_table.rb', line 118

def alter_columns(columns)
  false
end

#apply_flags(flags) ⇒ Object



126
127
128
# File 'lib/lib/coopy/json_table.rb', line 126

def apply_flags(flags)
  false
end

#as_tableObject



130
131
132
# File 'lib/lib/coopy/json_table.rb', line 130

def as_table 
  nil
end

#change_row(rc) ⇒ Object



122
123
124
# File 'lib/lib/coopy/json_table.rb', line 122

def change_row(rc)
  false
end

#clearObject



84
85
# File 'lib/lib/coopy/json_table.rb', line 84

def clear 
end

#cloneObject



103
104
105
# File 'lib/lib/coopy/json_table.rb', line 103

def clone 
  nil
end

#clone_meta(table = nil) ⇒ Object



134
135
136
# File 'lib/lib/coopy/json_table.rb', line 134

def clone_meta(table = nil)
  nil
end

#createObject



114
115
116
# File 'lib/lib/coopy/json_table.rb', line 114

def create 
  nil
end

#get_cell(x, y) ⇒ Object



59
60
61
62
# File 'lib/lib/coopy/json_table.rb', line 59

def get_cell(x,y)
  return @idx2col[x] if y == 0
  Reflect.field(@rows[y - 1],@idx2col[x])
end

#get_cell_viewObject



72
73
74
# File 'lib/lib/coopy/json_table.rb', line 72

def get_cell_view 
  ::Coopy::SimpleView.new
end

#get_dataObject



99
100
101
# File 'lib/lib/coopy/json_table.rb', line 99

def get_data 
  nil
end

#get_heightObject



55
56
57
# File 'lib/lib/coopy/json_table.rb', line 55

def get_height 
  @h + 1
end

#get_metaObject



110
111
112
# File 'lib/lib/coopy/json_table.rb', line 110

def get_meta 
  self
end

#get_nameObject



158
159
160
# File 'lib/lib/coopy/json_table.rb', line 158

def get_name 
  @name
end

#get_row_streamObject



146
147
148
# File 'lib/lib/coopy/json_table.rb', line 146

def get_row_stream 
  nil
end

#get_tableObject



42
43
44
# File 'lib/lib/coopy/json_table.rb', line 42

def get_table 
  self
end

#get_widthObject



51
52
53
# File 'lib/lib/coopy/json_table.rb', line 51

def get_width 
  @w
end

#heightObject



46
# File 'lib/lib/coopy/json_table.rb', line 46

def height() get_height end

#height=(__v) ⇒ Object



47
# File 'lib/lib/coopy/json_table.rb', line 47

def height=(__v) @height = __v end

#insert_or_delete_columns(fate, wfate) ⇒ Object



91
92
93
# File 'lib/lib/coopy/json_table.rb', line 91

def insert_or_delete_columns(fate,wfate)
  false
end

#insert_or_delete_rows(fate, hfate) ⇒ Object



87
88
89
# File 'lib/lib/coopy/json_table.rb', line 87

def insert_or_delete_rows(fate,hfate)
  false
end

#is_nestedObject



150
151
152
# File 'lib/lib/coopy/json_table.rb', line 150

def is_nested 
  false
end

#is_resizableObject



76
77
78
# File 'lib/lib/coopy/json_table.rb', line 76

def is_resizable 
  false
end

#is_sqlObject



154
155
156
# File 'lib/lib/coopy/json_table.rb', line 154

def is_sql 
  false
end

#resize(w, h) ⇒ Object



80
81
82
# File 'lib/lib/coopy/json_table.rb', line 80

def resize(w,h)
  false
end

#set_cell(x, y, c) ⇒ Object



64
65
66
# File 'lib/lib/coopy/json_table.rb', line 64

def set_cell(x,y,c)
  puts "JsonTable is read-only"
end

#set_meta(meta) ⇒ Object



107
108
# File 'lib/lib/coopy/json_table.rb', line 107

def set_meta(meta)
end

#to_sObject



68
69
70
# File 'lib/lib/coopy/json_table.rb', line 68

def to_s 
  ""
end

#trim_blankObject



95
96
97
# File 'lib/lib/coopy/json_table.rb', line 95

def trim_blank 
  false
end

#use_for_column_changesObject



138
139
140
# File 'lib/lib/coopy/json_table.rb', line 138

def use_for_column_changes 
  false
end

#use_for_row_changesObject



142
143
144
# File 'lib/lib/coopy/json_table.rb', line 142

def use_for_row_changes 
  false
end

#widthObject



48
# File 'lib/lib/coopy/json_table.rb', line 48

def width() get_width end

#width=(__v) ⇒ Object



49
# File 'lib/lib/coopy/json_table.rb', line 49

def width=(__v) @width = __v end