Sha256: 298928ec0af1075361eeb0de495047ede0c8def776cbe49de1291d75571b8d8f

Contents?: true

Size: 546 Bytes

Versions: 4

Compression:

Stored size: 546 Bytes

Contents

module SqlPostgres

  # This is the base class for the classes that represent column types.

  class PgType

    # Return true if +other+ is is equal to this object.

    def eql?(other)
      other.is_a?(self.class) && parts == other.parts
    end
    alias_method :==, :eql?

    # Return the hash code.

    def hash
      parts.to_s.hash
    end

    # Return the SQL representation.

    def to_sql
      "#{column_type} '#{to_s}'"
    end

  end

end

# Local Variables:
# tab-width: 2
# ruby-indent-level: 2
# indent-tabs-mode: nil
# End:

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sqlpostgres-1.3.0 lib/sqlpostgres/PgType.rb
sqlpostgres-1.2.6 lib/sqlpostgres/PgType.rb
sqlpostgres-1.2.5 lib/sqlpostgres/PgType.rb
sqlpostgres-1.2.4 lib/sqlpostgres/PgType.rb