Class: ActiveRecord::ConnectionAdapters::AbstractAdapter::Version
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::AbstractAdapter::Version
- Includes:
- Comparable
- Defined in:
- lib/active_record/connection_adapters/abstract_adapter.rb
Instance Attribute Summary collapse
-
#full_version_string ⇒ Object
readonly
Returns the value of attribute full_version_string.
Instance Method Summary collapse
- #<=>(version_string) ⇒ Object
-
#initialize(version_string, full_version_string = nil) ⇒ Version
constructor
A new instance of Version.
- #to_s ⇒ Object
Constructor Details
#initialize(version_string, full_version_string = nil) ⇒ Version
Returns a new instance of Version.
199 200 201 202 |
# File 'lib/active_record/connection_adapters/abstract_adapter.rb', line 199 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 ⇒ Object (readonly)
Returns the value of attribute full_version_string.
197 198 199 |
# File 'lib/active_record/connection_adapters/abstract_adapter.rb', line 197 def full_version_string @full_version_string end |
Instance Method Details
#<=>(version_string) ⇒ Object
204 205 206 |
# File 'lib/active_record/connection_adapters/abstract_adapter.rb', line 204 def <=>(version_string) @version <=> version_string.split(".").map(&:to_i) end |
#to_s ⇒ Object
208 209 210 |
# File 'lib/active_record/connection_adapters/abstract_adapter.rb', line 208 def to_s @version.join(".") end |