class Coopy::JsonTables

Attributes

db[RW]
flags[RW]
t[RW]

Public Class Methods

new(json,flags) click to toggle source
# File lib/lib/coopy/json_tables.rb, line 7
def initialize(json,flags)
  @db = json
  names = Reflect.field(json,"names")
  allowed = nil
  count = names.length
  if flags != nil && flags.tables != nil 
    allowed = {}
    begin
      _g = 0
      _g1 = flags.tables
      while(_g < _g1.length) 
        name = _g1[_g]
        _g+=1
        allowed[name] = true
      end
    end
    count = 0
    begin
      _g2 = 0
      while(_g2 < names.length) 
        name1 = names[_g2]
        _g2+=1
        count+=1 if allowed.include?(name1)
      end
    end
  end
  @t = ::Coopy::SimpleTable.new(2,count + 1)
  @t.set_cell(0,0,"name")
  @t.set_cell(1,0,"table")
  v = @t.get_cell_view
  at = 1
  begin
    _g3 = 0
    while(_g3 < names.length) 
      name2 = names[_g3]
      _g3+=1
      if allowed != nil 
        next if !allowed.include?(name2)
      end
      @t.set_cell(0,at,name2)
      tab = Reflect.field(@db,"tables")
      tab = Reflect.field(tab,name2)
      @t.set_cell(1,at,v.wrap_table(::Coopy::JsonTable.new(tab,name2)))
      at+=1
    end
  end
end

Public Instance Methods

clear() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 87
def clear 
end
clone() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 114
def clone 
  nil
end
create() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 122
def create 
  nil
end
get_cell(x,y) click to toggle source
# File lib/lib/coopy/json_tables.rb, line 68
def get_cell(x,y)
  @t.get_cell(x,y)
end
get_cell_view() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 75
def get_cell_view 
  @t.get_cell_view
end
get_data() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 110
def get_data 
  nil
end
get_height() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 106
def get_height 
  @t.get_height
end
get_meta() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 118
def get_meta 
  ::Coopy::SimpleMeta.new(self,true,true)
end
get_width() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 102
def get_width 
  @t.get_width
end
height() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 63
def height() get_height end
height=(__v) click to toggle source
# File lib/lib/coopy/json_tables.rb, line 64
def height=(__v) @height = __v end
insert_or_delete_columns(fate,wfate) click to toggle source
# File lib/lib/coopy/json_tables.rb, line 94
def insert_or_delete_columns(fate,wfate)
  false
end
insert_or_delete_rows(fate,hfate) click to toggle source
# File lib/lib/coopy/json_tables.rb, line 90
def insert_or_delete_rows(fate,hfate)
  false
end
is_resizable() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 79
def is_resizable 
  false
end
resize(w,h) click to toggle source
# File lib/lib/coopy/json_tables.rb, line 83
def resize(w,h)
  false
end
set_cell(x,y,c) click to toggle source
# File lib/lib/coopy/json_tables.rb, line 72
def set_cell(x,y,c)
end
trim_blank() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 98
def trim_blank 
  false
end
width() click to toggle source
# File lib/lib/coopy/json_tables.rb, line 65
def width() get_width end
width=(__v) click to toggle source
# File lib/lib/coopy/json_tables.rb, line 66
def width=(__v) @width = __v end