123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ConnectionAdapters::SqlTypeMetadata

Do not use. This class is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, Deduplicable
Inherits: Object
Defined in: activerecord/lib/active_record/connection_adapters/sql_type_metadata.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(sql_type: nil, type: nil, limit: nil, precision: nil, scale: nil) ⇒ SqlTypeMetadata

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sql_type_metadata.rb', line 11

def initialize(sql_type: nil, type: nil, limit: nil, precision: nil, scale: nil)
  @sql_type = sql_type
  @type = type
  @limit = limit
  @precision = precision
  @scale = scale
end

Instance Attribute Details

#limit (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sql_type_metadata.rb', line 9

attr_reader :sql_type, :type, :limit, :precision, :scale

#precision (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sql_type_metadata.rb', line 9

attr_reader :sql_type, :type, :limit, :precision, :scale

#scale (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sql_type_metadata.rb', line 9

attr_reader :sql_type, :type, :limit, :precision, :scale

#sql_type (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sql_type_metadata.rb', line 9

attr_reader :sql_type, :type, :limit, :precision, :scale

#type (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sql_type_metadata.rb', line 9

attr_reader :sql_type, :type, :limit, :precision, :scale

Instance Method Details

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

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sql_type_metadata.rb', line 19

def ==(other)
  other.is_a?(SqlTypeMetadata) &&
    sql_type == other.sql_type &&
    type == other.type &&
    limit == other.limit &&
    precision == other.precision &&
    scale == other.scale
end

#deduplicated (private)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sql_type_metadata.rb', line 39

def deduplicated
  @sql_type = -sql_type
  super
end

#eql?(other)

Alias for #==.

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sql_type_metadata.rb', line 27

alias eql? ==

#hash

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sql_type_metadata.rb', line 29

def hash
  SqlTypeMetadata.hash ^
    sql_type.hash ^
    type.hash ^
    limit.hash ^
    precision.hash >> 1 ^
    scale.hash >> 2
end