Class: SqlTools::Schema
- Inherits:
-
Object
- Object
- SqlTools::Schema
- Defined in:
- lib/sql_tools/schema.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#constraints ⇒ Object
readonly
Returns the value of attribute constraints.
-
#create_table ⇒ Object
Returns the value of attribute create_table.
Instance Method Summary collapse
- #indices ⇒ Object
-
#initialize ⇒ Schema
constructor
A new instance of Schema.
Constructor Details
#initialize ⇒ Schema
Returns a new instance of Schema.
6 7 8 9 |
# File 'lib/sql_tools/schema.rb', line 6 def initialize @columns = [] @constraints = [] end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
4 5 6 |
# File 'lib/sql_tools/schema.rb', line 4 def columns @columns end |
#constraints ⇒ Object (readonly)
Returns the value of attribute constraints.
4 5 6 |
# File 'lib/sql_tools/schema.rb', line 4 def constraints @constraints end |
#create_table ⇒ Object
Returns the value of attribute create_table.
3 4 5 |
# File 'lib/sql_tools/schema.rb', line 3 def create_table @create_table end |
Instance Method Details
#indices ⇒ Object
11 |
# File 'lib/sql_tools/schema.rb', line 11 def indices = @constraints.select { |c| c.is_a?(Index) } |