Class: ElastomerClient::VersionSupport

Inherits:
Object
  • Object
show all
Defined in:
lib/elastomer_client/version_support.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#versionObject (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.

Returns:

  • (Boolean)


20
21
22
# File 'lib/elastomer_client/version_support.rb', line 20

def es_version_8_plus?
  version >= "8.0.0"
end