Class: Coopy::JsonTables

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

Instance Method Summary collapse

Constructor Details

#initialize(json, flags) ⇒ JsonTables

Returns a new instance of JsonTables.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 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

Instance Method Details

#clearObject



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

def clear 
end

#cloneObject



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

def clone 
  nil
end

#createObject



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

def create 
  nil
end

#get_cell(x, y) ⇒ Object



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

def get_cell(x,y)
  @t.get_cell(x,y)
end

#get_cell_viewObject



75
76
77
# File 'lib/lib/coopy/json_tables.rb', line 75

def get_cell_view 
  @t.get_cell_view
end

#get_dataObject



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

def get_data 
  nil
end

#get_heightObject



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

def get_height 
  @t.get_height
end

#get_metaObject



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

def get_meta 
  ::Coopy::SimpleMeta.new(self,true,true)
end

#get_widthObject



102
103
104
# File 'lib/lib/coopy/json_tables.rb', line 102

def get_width 
  @t.get_width
end

#heightObject



63
# File 'lib/lib/coopy/json_tables.rb', line 63

def height() get_height end

#height=(__v) ⇒ Object



64
# File 'lib/lib/coopy/json_tables.rb', line 64

def height=(__v) @height = __v end

#insert_or_delete_columns(fate, wfate) ⇒ Object



94
95
96
# File 'lib/lib/coopy/json_tables.rb', line 94

def insert_or_delete_columns(fate,wfate)
  false
end

#insert_or_delete_rows(fate, hfate) ⇒ Object



90
91
92
# File 'lib/lib/coopy/json_tables.rb', line 90

def insert_or_delete_rows(fate,hfate)
  false
end

#is_resizableObject



79
80
81
# File 'lib/lib/coopy/json_tables.rb', line 79

def is_resizable 
  false
end

#resize(w, h) ⇒ Object



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

def resize(w,h)
  false
end

#set_cell(x, y, c) ⇒ Object



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

def set_cell(x,y,c)
end

#trim_blankObject



98
99
100
# File 'lib/lib/coopy/json_tables.rb', line 98

def trim_blank 
  false
end

#widthObject



65
# File 'lib/lib/coopy/json_tables.rb', line 65

def width() get_width end

#width=(__v) ⇒ Object



66
# File 'lib/lib/coopy/json_tables.rb', line 66

def width=(__v) @width = __v end