Class: PgHaMigrations::CheckConstraint
- Inherits:
-
Struct
- Object
- Struct
- PgHaMigrations::CheckConstraint
- Defined in:
- lib/pg_ha_migrations/constraint.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
Returns the value of attribute definition.
-
#name ⇒ Object
Returns the value of attribute name.
-
#validated ⇒ Object
Returns the value of attribute validated.
Instance Method Summary collapse
-
#initialize(name, definition, validated) ⇒ CheckConstraint
constructor
A new instance of CheckConstraint.
Constructor Details
#initialize(name, definition, validated) ⇒ CheckConstraint
Returns a new instance of CheckConstraint.
2 3 4 5 6 7 |
# File 'lib/pg_ha_migrations/constraint.rb', line 2 def initialize(name, definition, validated) # pg_get_constraintdef includes NOT VALID in the definition, # but we return that as a separate attribute. definition = definition&.gsub(/ NOT VALID\Z/, "") super(name, definition, validated) end |
Instance Attribute Details
#definition ⇒ Object
Returns the value of attribute definition
1 2 3 |
# File 'lib/pg_ha_migrations/constraint.rb', line 1 def definition @definition end |
#name ⇒ Object
Returns the value of attribute name
1 2 3 |
# File 'lib/pg_ha_migrations/constraint.rb', line 1 def name @name end |
#validated ⇒ Object
Returns the value of attribute validated
1 2 3 |
# File 'lib/pg_ha_migrations/constraint.rb', line 1 def validated @validated end |