Class: Lhm::Table
- Inherits:
-
Object
- Object
- Lhm::Table
- Defined in:
- lib/lhm/table.rb
Defined Under Namespace
Classes: Parser
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#ddl ⇒ Object
readonly
Returns the value of attribute ddl.
-
#indices ⇒ Object
readonly
Returns the value of attribute indices.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pk ⇒ Object
readonly
Returns the value of attribute pk.
Class Method Summary collapse
Instance Method Summary collapse
- #destination_name ⇒ Object
-
#initialize(name, pk = 'id', ddl = nil) ⇒ Table
constructor
A new instance of Table.
- #satisfies_id_column_requirement? ⇒ Boolean
Constructor Details
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
8 9 10 |
# File 'lib/lhm/table.rb', line 8 def columns @columns end |
#ddl ⇒ Object (readonly)
Returns the value of attribute ddl.
8 9 10 |
# File 'lib/lhm/table.rb', line 8 def ddl @ddl end |
#indices ⇒ Object (readonly)
Returns the value of attribute indices.
8 9 10 |
# File 'lib/lhm/table.rb', line 8 def indices @indices end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/lhm/table.rb', line 8 def name @name end |
#pk ⇒ Object (readonly)
Returns the value of attribute pk.
8 9 10 |
# File 'lib/lhm/table.rb', line 8 def pk @pk end |
Class Method Details
Instance Method Details
#destination_name ⇒ Object
24 25 26 |
# File 'lib/lhm/table.rb', line 24 def destination_name @destination_name ||= @table_name.new end |
#satisfies_id_column_requirement? ⇒ Boolean
19 20 21 22 |
# File 'lib/lhm/table.rb', line 19 def satisfies_id_column_requirement? !!((id = columns['id']) && id[:type] =~ /(bigint|int)(\(\d+\))?/) end |