123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ConnectionAdapters::AbstractAdapter::Version

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, Comparable
Inherits: Object
Defined in: activerecord/lib/active_record/connection_adapters/abstract_adapter.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(version_string, full_version_string = nil) ⇒ Version

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb', line 257

def initialize(version_string, full_version_string = nil)
  @version = version_string.split(".").map(&:to_i)
  @full_version_string = full_version_string
end

Instance Attribute Details

#full_version_string (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb', line 255

attr_reader :full_version_string

Instance Method Details

#<=>(version_string)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb', line 262

def <=>(version_string)
  @version <=> version_string.split(".").map(&:to_i)
end

#to_s

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb', line 266

def to_s
  @version.join(".")
end