Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID::Vector

Inherits:
Type
  • Object
show all
Defined in:
activerecord/lib/active_record/connection_adapters/postgresql/oid.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#type, #type_cast_for_write

Constructor Details

#initialize(delim, subtype) ⇒ Vector

delim corresponds to the `typdelim` column in the pg_types table. subtype is derived from the `typelem` column in the pg_types table.


64
65
66
67
# File 'activerecord/lib/active_record/connection_adapters/postgresql/oid.rb', line 64

def initialize(delim, subtype)
  @delim   = delim
  @subtype = subtype
end

Instance Attribute Details

#delimObject (readonly)

Returns the value of attribute delim


59
60
61
# File 'activerecord/lib/active_record/connection_adapters/postgresql/oid.rb', line 59

def delim
  @delim
end

#subtypeObject (readonly)

Returns the value of attribute subtype


59
60
61
# File 'activerecord/lib/active_record/connection_adapters/postgresql/oid.rb', line 59

def subtype
  @subtype
end

Instance Method Details

#type_cast(value) ⇒ Object

FIXME: this should probably split on delim and use subtype to cast the values. Unfortunately, the current Rails behavior is to just return the string.


72
73
74
# File 'activerecord/lib/active_record/connection_adapters/postgresql/oid.rb', line 72

def type_cast(value)
  value
end