Class: ElastomerClient::VersionSupport
- Inherits:
-
Object
- Object
- ElastomerClient::VersionSupport
- Defined in:
- lib/elastomer_client/version_support.rb
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#es_version_8_plus? ⇒ Boolean
Returns true if Elasticsearch version is 8.x or higher.
-
#initialize(version) ⇒ VersionSupport
constructor
version - an Elasticsearch version string e.g., 5.6.6 or 8.7.0.
Constructor Details
#initialize(version) ⇒ VersionSupport
version - an Elasticsearch version string e.g., 5.6.6 or 8.7.0
Raises ArgumentError if version is unsupported.
11 12 13 14 15 16 17 |
# File 'lib/elastomer_client/version_support.rb', line 11 def initialize(version) if version < "5.0" || version >= "9.0" raise ArgumentError, "Elasticsearch version #{version} is not supported by elastomer-client" end @version = version end |
Instance Attribute Details
#version ⇒ Object (readonly)
Returns the value of attribute version.
6 7 8 |
# File 'lib/elastomer_client/version_support.rb', line 6 def version @version end |
Instance Method Details
#es_version_8_plus? ⇒ Boolean
Returns true if Elasticsearch version is 8.x or higher.
20 21 22 |
# File 'lib/elastomer_client/version_support.rb', line 20 def es_version_8_plus? version >= "8.0.0" end |