Class: ActiveRecord::ConnectionAdapters::PostgreSQL::TypeMetadata

Inherits:
SqlTypeMetadata
  • Object
show all
Includes:
Deduplicable
Defined in:
lib/active_record/connection_adapters/postgresql/type_metadata.rb

Instance Attribute Summary collapse

Attributes inherited from SqlTypeMetadata

#limit, #precision, #scale, #sql_type, #type

Instance Method Summary collapse

Methods included from Deduplicable

#deduplicate

Constructor Details

#initialize(type_metadata, oid: nil, fmod: nil) ⇒ TypeMetadata

Returns a new instance of TypeMetadata.



14
15
16
17
18
# File 'lib/active_record/connection_adapters/postgresql/type_metadata.rb', line 14

def initialize(, oid: nil, fmod: nil)
  super()
  @oid = oid
  @fmod = fmod
end

Instance Attribute Details

#fmodObject (readonly)

Returns the value of attribute fmod.



12
13
14
# File 'lib/active_record/connection_adapters/postgresql/type_metadata.rb', line 12

def fmod
  @fmod
end

#oidObject (readonly)

Returns the value of attribute oid.



12
13
14
# File 'lib/active_record/connection_adapters/postgresql/type_metadata.rb', line 12

def oid
  @oid
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



20
21
22
23
24
25
# File 'lib/active_record/connection_adapters/postgresql/type_metadata.rb', line 20

def ==(other)
  other.is_a?(TypeMetadata) &&
    __getobj__ == other.__getobj__ &&
    oid == other.oid &&
    fmod == other.fmod
end

#hashObject



28
29
30
31
32
33
# File 'lib/active_record/connection_adapters/postgresql/type_metadata.rb', line 28

def hash
  TypeMetadata.hash ^
    __getobj__.hash ^
    oid.hash ^
    fmod.hash
end