Class: ActiveRecord::ConnectionAdapters::MySQL::TypeMetadata

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

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from SqlTypeMetadata

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

Instance Method Summary collapse

Constructor Details

#initialize(type_metadata, extra: "") ⇒ TypeMetadata

Returns a new instance of TypeMetadata.



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

def initialize(, extra: "")
  super()
  @extra = extra
end

Instance Attribute Details

#extraObject (readonly)

Returns the value of attribute extra.



9
10
11
# File 'lib/active_record/connection_adapters/mysql/type_metadata.rb', line 9

def extra
  @extra
end

Instance Method Details

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



16
17
18
19
20
# File 'lib/active_record/connection_adapters/mysql/type_metadata.rb', line 16

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

#hashObject



23
24
25
26
27
# File 'lib/active_record/connection_adapters/mysql/type_metadata.rb', line 23

def hash
  TypeMetadata.hash ^
    __getobj__.hash ^
    extra.hash
end