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

#infinity, #simplified_type

Constructor Details

#initialize(subtype) ⇒ Array

Returns a new instance of Array.



140
141
142
# File 'lib/arjdbc/postgresql/base/oid.rb', line 140

def initialize(subtype)
  @subtype = subtype
end

Instance Attribute Details

#subtypeObject (readonly)

Returns the value of attribute subtype.



139
140
141
# File 'lib/arjdbc/postgresql/base/oid.rb', line 139

def subtype
  @subtype
end

Instance Method Details

#typeObject



137
# File 'lib/arjdbc/postgresql/base/oid.rb', line 137

def type; @subtype.type end

#type_cast(value) ⇒ Object



144
145
146
147
148
149
150
# File 'lib/arjdbc/postgresql/base/oid.rb', line 144

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