Class: SqlPostgres::PgType
- Inherits:
-
Object
- Object
- SqlPostgres::PgType
- Defined in:
- lib/sqlpostgres/PgType.rb
Overview
This is the base class for the classes that represent column types.
Direct Known Subclasses
PgBit, PgCircle, PgInterval, PgPath, PgPoint, PgPolygon, PgTime, PgTimeWithTimeZone, PgTimestamp, PgTwoPoints, PgWrapper
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
(also: #==)
Return true if
other
is is equal to this object. -
#hash ⇒ Object
Return the hash code.
-
#to_sql ⇒ Object
Return the SQL representation.
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
Return true if other
is is equal to this object.
9 10 11 |
# File 'lib/sqlpostgres/PgType.rb', line 9 def eql?(other) other.is_a?(self.class) && parts == other.parts end |
#hash ⇒ Object
Return the hash code.
16 17 18 |
# File 'lib/sqlpostgres/PgType.rb', line 16 def hash parts.to_s.hash end |
#to_sql ⇒ Object
Return the SQL representation.
22 23 24 |
# File 'lib/sqlpostgres/PgType.rb', line 22 def to_sql "#{column_type} '#{to_s}'" end |