Class: Coopy::Tables
- Inherits:
-
Object
- Object
- Coopy::Tables
- Defined in:
- lib/lib/coopy/tables.rb
Instance Attribute Summary collapse
-
#alignment ⇒ Object
Returns the value of attribute alignment.
Instance Method Summary collapse
- #add(name) ⇒ Object
- #get(name) ⇒ Object
- #get_order ⇒ Object
- #has_ins_del ⇒ Object
-
#initialize(template) ⇒ Tables
constructor
A new instance of Tables.
- #one ⇒ Object
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
#alignment ⇒ Object
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_order ⇒ Object
30 31 32 |
# File 'lib/lib/coopy/tables.rb', line 30 def get_order @table_order end |
#has_ins_del ⇒ Object
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 |
#one ⇒ Object
38 39 40 |
# File 'lib/lib/coopy/tables.rb', line 38 def one @tables[@table_order[0]] end |