Class: Coopy::JsonTable
- Inherits:
-
Object
- Object
- Coopy::JsonTable
- Defined in:
- lib/lib/coopy/json_table.rb
Instance Method Summary collapse
- #alter_columns(columns) ⇒ Object
- #apply_flags(flags) ⇒ Object
- #as_table ⇒ Object
- #change_row(rc) ⇒ Object
- #clear ⇒ Object
- #clone ⇒ Object
- #clone_meta(table = nil) ⇒ Object
- #create ⇒ Object
- #get_cell(x, y) ⇒ Object
- #get_cell_view ⇒ Object
- #get_data ⇒ Object
- #get_height ⇒ Object
- #get_meta ⇒ Object
- #get_name ⇒ Object
- #get_row_stream ⇒ Object
- #get_table ⇒ Object
- #get_width ⇒ Object
- #height ⇒ Object
- #height=(__v) ⇒ Object
-
#initialize(data, name) ⇒ JsonTable
constructor
A new instance of JsonTable.
- #insert_or_delete_columns(fate, wfate) ⇒ Object
- #insert_or_delete_rows(fate, hfate) ⇒ Object
- #is_nested ⇒ Object
- #is_resizable ⇒ Object
- #is_sql ⇒ Object
- #resize(w, h) ⇒ Object
- #set_cell(x, y, c) ⇒ Object
- #set_meta(meta) ⇒ Object
- #to_s ⇒ Object
- #trim_blank ⇒ Object
- #use_for_column_changes ⇒ Object
- #use_for_row_changes ⇒ Object
- #width ⇒ Object
- #width=(__v) ⇒ Object
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_table ⇒ Object
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 |
#clear ⇒ Object
84 85 |
# File 'lib/lib/coopy/json_table.rb', line 84 def clear end |
#clone ⇒ Object
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 (table = nil) nil end |
#create ⇒ Object
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_view ⇒ Object
72 73 74 |
# File 'lib/lib/coopy/json_table.rb', line 72 def get_cell_view ::Coopy::SimpleView.new end |
#get_data ⇒ Object
99 100 101 |
# File 'lib/lib/coopy/json_table.rb', line 99 def get_data nil end |
#get_height ⇒ Object
55 56 57 |
# File 'lib/lib/coopy/json_table.rb', line 55 def get_height @h + 1 end |
#get_meta ⇒ Object
110 111 112 |
# File 'lib/lib/coopy/json_table.rb', line 110 def self end |
#get_name ⇒ Object
158 159 160 |
# File 'lib/lib/coopy/json_table.rb', line 158 def get_name @name end |
#get_row_stream ⇒ Object
146 147 148 |
# File 'lib/lib/coopy/json_table.rb', line 146 def get_row_stream nil end |
#get_table ⇒ Object
42 43 44 |
# File 'lib/lib/coopy/json_table.rb', line 42 def get_table self end |
#get_width ⇒ Object
51 52 53 |
# File 'lib/lib/coopy/json_table.rb', line 51 def get_width @w end |
#height ⇒ Object
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_nested ⇒ Object
150 151 152 |
# File 'lib/lib/coopy/json_table.rb', line 150 def is_nested false end |
#is_resizable ⇒ Object
76 77 78 |
# File 'lib/lib/coopy/json_table.rb', line 76 def is_resizable false end |
#is_sql ⇒ Object
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 () end |
#to_s ⇒ Object
68 69 70 |
# File 'lib/lib/coopy/json_table.rb', line 68 def to_s "" end |
#trim_blank ⇒ Object
95 96 97 |
# File 'lib/lib/coopy/json_table.rb', line 95 def trim_blank false end |
#use_for_column_changes ⇒ Object
138 139 140 |
# File 'lib/lib/coopy/json_table.rb', line 138 def use_for_column_changes false end |
#use_for_row_changes ⇒ Object
142 143 144 |
# File 'lib/lib/coopy/json_table.rb', line 142 def use_for_row_changes false end |
#width ⇒ Object
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 |