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

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version_string, full_version_string = nil) ⇒ Version

Returns a new instance of Version.


203
204
205
206
# File 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb', line 203

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_stringObject (readonly)

Returns the value of attribute full_version_string.


201
202
203
# File 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb', line 201

def full_version_string
  @full_version_string
end

Instance Method Details

#<=>(version_string) ⇒ Object


208
209
210
# File 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb', line 208

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

#to_sObject


212
213
214
# File 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb', line 212

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