Class: Influxdb::Api::ServerVersion
- Inherits:
-
Object
- Object
- Influxdb::Api::ServerVersion
- Includes:
- Comparable
- Defined in:
- lib/influxdb/api/server_version.rb
Defined Under Namespace
Classes: Engine
Constant Summary collapse
- REGEXP =
InfluxDB v0.7.3 (git: 023abcdef) (leveldb: 1.7)
/^InfluxDB\sv(\d+)\.(\d+)\.(\d+)\s\(git:\s([0-9abcdef]+)\)\s\((\w+):\s(\d+)\.(\d+)\)$/
Instance Attribute Summary collapse
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#major ⇒ Object
readonly
Returns the value of attribute major.
-
#minor ⇒ Object
readonly
Returns the value of attribute minor.
-
#patch ⇒ Object
readonly
Returns the value of attribute patch.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(source) ⇒ ServerVersion
constructor
A new instance of ServerVersion.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(source) ⇒ ServerVersion
Returns a new instance of ServerVersion.
27 28 29 30 |
# File 'lib/influxdb/api/server_version.rb', line 27 def initialize(source) @source = source parse! end |
Instance Attribute Details
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
25 26 27 |
# File 'lib/influxdb/api/server_version.rb', line 25 def engine @engine end |
#git ⇒ Object (readonly)
Returns the value of attribute git.
25 26 27 |
# File 'lib/influxdb/api/server_version.rb', line 25 def git @git end |
#major ⇒ Object (readonly)
Returns the value of attribute major.
25 26 27 |
# File 'lib/influxdb/api/server_version.rb', line 25 def major @major end |
#minor ⇒ Object (readonly)
Returns the value of attribute minor.
25 26 27 |
# File 'lib/influxdb/api/server_version.rb', line 25 def minor @minor end |
#patch ⇒ Object (readonly)
Returns the value of attribute patch.
25 26 27 |
# File 'lib/influxdb/api/server_version.rb', line 25 def patch @patch end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
25 26 27 |
# File 'lib/influxdb/api/server_version.rb', line 25 def source @source end |
Instance Method Details
#<=>(other) ⇒ Object
32 33 34 35 |
# File 'lib/influxdb/api/server_version.rb', line 32 def <=>(other) other_major, other_minor, other_patch = (other.to_s.split('.', 3) + [0] * 3).first(3).map(&:to_i) [major <=> other_major, minor <=> other_minor, patch <=> other_patch].detect{|c| c != 0 } || 0 end |
#inspect ⇒ Object
41 42 43 |
# File 'lib/influxdb/api/server_version.rb', line 41 def inspect to_s.inspect end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/influxdb/api/server_version.rb', line 37 def to_s source end |