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_primary_key? ⇒ Boolean
Constructor Details
#initialize(name, pk = 'id', ddl = nil) ⇒ Table
Returns a new instance of Table.
10 11 12 13 14 15 16 |
# File 'lib/lhm/table.rb', line 10 def initialize(name, pk = 'id', ddl = nil) @name = name @columns = {} @indices = {} @pk = pk @ddl = ddl end |
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
22 23 24 |
# File 'lib/lhm/table.rb', line 22 def destination_name "lhmn_#{ @name }" end |
#satisfies_primary_key? ⇒ Boolean
18 19 20 |
# File 'lib/lhm/table.rb', line 18 def satisfies_primary_key? @pk == 'id' end |