Class: ActiveRecord::ConnectionAdapters::Mysql2Adapter::Version

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/activerecord-mysql-awesome/active_record/connection_adapters/mysql2_adapter.rb

Instance Method Summary collapse

Constructor Details

#initialize(version_string) ⇒ Version

Returns a new instance of Version.



9
10
11
# File 'lib/activerecord-mysql-awesome/active_record/connection_adapters/mysql2_adapter.rb', line 9

def initialize(version_string)
  @version = version_string.split('.').map(&:to_i)
end

Instance Method Details

#<=>(version_string) ⇒ Object



13
14
15
# File 'lib/activerecord-mysql-awesome/active_record/connection_adapters/mysql2_adapter.rb', line 13

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

#[](index) ⇒ Object



17
18
19
# File 'lib/activerecord-mysql-awesome/active_record/connection_adapters/mysql2_adapter.rb', line 17

def [](index)
  @version[index]
end