Class: Peegee::PrimaryKey

Inherits:
Constraint show all
Defined in:
lib/peegee/primary_key.rb

Instance Method Summary collapse

Methods inherited from Constraint

#create, #drop

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_nameObject

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_sObject

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