Class: DBLeftovers::Constraint
- Inherits:
-
Object
- Object
- DBLeftovers::Constraint
- Defined in:
- lib/db_leftovers/constraint.rb
Instance Attribute Summary collapse
-
#check ⇒ Object
Returns the value of attribute check.
-
#constraint_name ⇒ Object
Returns the value of attribute constraint_name.
-
#on_table ⇒ Object
Returns the value of attribute on_table.
Instance Method Summary collapse
- #equals(other) ⇒ Object
-
#initialize(constraint_name, on_table, check) ⇒ Constraint
constructor
A new instance of Constraint.
- #to_s ⇒ Object
Constructor Details
#initialize(constraint_name, on_table, check) ⇒ Constraint
Returns a new instance of Constraint.
6 7 8 9 10 |
# File 'lib/db_leftovers/constraint.rb', line 6 def initialize(constraint_name, on_table, check) @constraint_name = constraint_name.to_s @on_table = on_table.to_s @check = check end |
Instance Attribute Details
#check ⇒ Object
Returns the value of attribute check.
4 5 6 |
# File 'lib/db_leftovers/constraint.rb', line 4 def check @check end |
#constraint_name ⇒ Object
Returns the value of attribute constraint_name.
4 5 6 |
# File 'lib/db_leftovers/constraint.rb', line 4 def constraint_name @constraint_name end |
#on_table ⇒ Object
Returns the value of attribute on_table.
4 5 6 |
# File 'lib/db_leftovers/constraint.rb', line 4 def on_table @on_table end |
Instance Method Details
#equals(other) ⇒ Object
12 13 14 15 16 |
# File 'lib/db_leftovers/constraint.rb', line 12 def equals(other) other.constraint_name == constraint_name and other.on_table == on_table and other.check == check end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/db_leftovers/constraint.rb', line 18 def to_s "<#{@constraint_name}: #{@on_table} CHECK (#{@check})>" end |