Class: Coopy::Tables

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template) ⇒ Tables

Returns a new instance of Tables.



7
8
9
10
11
# File 'lib/lib/coopy/tables.rb', line 7

def initialize(template)
  @template = template
  @tables = {}
  @table_order = Array.new
end

Instance Attribute Details

#alignmentObject

Returns the value of attribute alignment.



21
22
23
# File 'lib/lib/coopy/tables.rb', line 21

def alignment
  @alignment
end

Instance Method Details

#add(name) ⇒ Object



23
24
25
26
27
28
# File 'lib/lib/coopy/tables.rb', line 23

def add(name)
  t = @template.clone
  @tables[name] = t
  @table_order.push(name)
  t
end

#get(name) ⇒ Object



34
35
36
# File 'lib/lib/coopy/tables.rb', line 34

def get(name)
  @tables[name]
end

#get_orderObject



30
31
32
# File 'lib/lib/coopy/tables.rb', line 30

def get_order 
  @table_order
end

#has_ins_delObject



42
43
44
45
46
47
# File 'lib/lib/coopy/tables.rb', line 42

def has_ins_del 
  return false if @alignment == nil
  return true if @alignment.has_addition
  return true if @alignment.has_removal
  false
end

#oneObject



38
39
40
# File 'lib/lib/coopy/tables.rb', line 38

def one 
  @tables[@table_order[0]]
end