Class: Coopy::SqlTables

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

Instance Method Summary collapse

Constructor Details

#initialize(db, flags) ⇒ SqlTables

Returns a new instance of SqlTables.



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
# File 'lib/lib/coopy/sql_tables.rb', line 7

def initialize(db,flags)
  @db = db
  helper = @db.get_helper
  names = helper.get_table_names(db)
  allowed = nil
  count = names.length
  if 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)
      @t.set_cell(1,at,v.wrap_table(::Coopy::SqlTable.new(db,::Coopy::SqlTableName.new(name2))))
      at+=1
    end
  end
end

Instance Method Details

#clearObject



86
87
# File 'lib/lib/coopy/sql_tables.rb', line 86

def clear 
end

#cloneObject



113
114
115
# File 'lib/lib/coopy/sql_tables.rb', line 113

def clone 
  nil
end

#createObject



117
118
119
# File 'lib/lib/coopy/sql_tables.rb', line 117

def create 
  nil
end

#get_cell(x, y) ⇒ Object



67
68
69
# File 'lib/lib/coopy/sql_tables.rb', line 67

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

#get_cell_viewObject



74
75
76
# File 'lib/lib/coopy/sql_tables.rb', line 74

def get_cell_view 
  @t.get_cell_view
end

#get_dataObject



109
110
111
# File 'lib/lib/coopy/sql_tables.rb', line 109

def get_data 
  nil
end

#get_heightObject



105
106
107
# File 'lib/lib/coopy/sql_tables.rb', line 105

def get_height 
  @t.get_height
end

#get_metaObject



121
122
123
# File 'lib/lib/coopy/sql_tables.rb', line 121

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

#get_widthObject



101
102
103
# File 'lib/lib/coopy/sql_tables.rb', line 101

def get_width 
  @t.get_width
end

#heightObject



62
# File 'lib/lib/coopy/sql_tables.rb', line 62

def height() get_height end

#height=(__v) ⇒ Object



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

def height=(__v) @height = __v end

#insert_or_delete_columns(fate, wfate) ⇒ Object



93
94
95
# File 'lib/lib/coopy/sql_tables.rb', line 93

def insert_or_delete_columns(fate,wfate)
  false
end

#insert_or_delete_rows(fate, hfate) ⇒ Object



89
90
91
# File 'lib/lib/coopy/sql_tables.rb', line 89

def insert_or_delete_rows(fate,hfate)
  false
end

#is_resizableObject



78
79
80
# File 'lib/lib/coopy/sql_tables.rb', line 78

def is_resizable 
  false
end

#resize(w, h) ⇒ Object



82
83
84
# File 'lib/lib/coopy/sql_tables.rb', line 82

def resize(w,h)
  false
end

#set_cell(x, y, c) ⇒ Object



71
72
# File 'lib/lib/coopy/sql_tables.rb', line 71

def set_cell(x,y,c)
end

#trim_blankObject



97
98
99
# File 'lib/lib/coopy/sql_tables.rb', line 97

def trim_blank 
  false
end

#widthObject



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

def width() get_width end

#width=(__v) ⇒ Object



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

def width=(__v) @width = __v end