Class: Peegee::PrimaryKey
- Inherits:
-
Constraint
- Object
- Constraint
- Peegee::PrimaryKey
- Defined in:
- lib/peegee/primary_key.rb
Instance Method Summary collapse
-
#initialize(opts) ⇒ PrimaryKey
constructor
A new instance of PrimaryKey.
-
#primary_key_name ⇒ Object
Returns the name of this primary key.
-
#to_s ⇒ Object
Returns human readable primary key definition.
Methods inherited from Constraint
Constructor Details
#initialize(opts) ⇒ PrimaryKey
Returns a new instance of PrimaryKey.
4 5 6 |
# File 'lib/peegee/primary_key.rb', line 4 def initialize(opts) super(opts) end |
Instance Method Details
#primary_key_name ⇒ Object
Returns the name of this primary key.
9 10 11 |
# File 'lib/peegee/primary_key.rb', line 9 def primary_key_name @constraint_name end |
#to_s ⇒ Object
Returns human readable primary key definition
14 15 16 |
# File 'lib/peegee/primary_key.rb', line 14 def to_s "Primary Key: #{primary_key_name} on #{@table_name}" end |