Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID::Array

Inherits:
Type
  • Object
show all
Defined in:
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(subtype) ⇒ Array

Returns a new instance of Array.



94
95
96
# File 'lib/active_record/connection_adapters/postgresql/oid.rb', line 94

def initialize(subtype)
  @subtype = subtype
end

Instance Attribute Details

#subtypeObject (readonly)

Returns the value of attribute subtype.



93
94
95
# File 'lib/active_record/connection_adapters/postgresql/oid.rb', line 93

def subtype
  @subtype
end

Instance Method Details

#type_cast(value) ⇒ Object



98
99
100
101
102
103
104
# File 'lib/active_record/connection_adapters/postgresql/oid.rb', line 98

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