Class: ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array

Inherits:
Type
  • Object
show all
Defined in:
lib/arjdbc/postgresql/base/oid.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#type

Constructor Details

#initialize(subtype) ⇒ Array

Returns a new instance of Array.



90
91
92
# File 'lib/arjdbc/postgresql/base/oid.rb', line 90

def initialize(subtype)
  @subtype = subtype
end

Instance Attribute Details

#subtypeObject (readonly)

Returns the value of attribute subtype.



89
90
91
# File 'lib/arjdbc/postgresql/base/oid.rb', line 89

def subtype
  @subtype
end

Instance Method Details

#type_cast(value) ⇒ Object



94
95
96
97
98
99
100
# File 'lib/arjdbc/postgresql/base/oid.rb', line 94

def type_cast(value)
  if ::String === value
    ConnectionAdapters::PostgreSQLColumn.string_to_array value, @subtype
  else
    value
  end
end