Class: Kameleoon::Targeting::VersionCondition Private

Inherits:
Condition
  • Object
show all
Defined in:
lib/kameleoon/targeting/conditions/version_condition.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

VersionCondition is a base class for conditions that compare versions. Subclasses should implement ‘check` method and call `compare_with_version` for version comparison.

Direct Known Subclasses

SdkLanguageCondition

Instance Attribute Summary

Attributes inherited from Condition

#id, #include, #type

Instance Method Summary collapse

Constructor Details

#initialize(json_condition) ⇒ VersionCondition

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of VersionCondition.



13
14
15
16
17
18
# File 'lib/kameleoon/targeting/conditions/version_condition.rb', line 13

def initialize(json_condition)
  super(json_condition)
  @version = json_condition['version']
  @version_match_type = json_condition['versionMatchType']
  @cached_version_condition = nil
end

Instance Method Details

#check(data) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/kameleoon/targeting/conditions/version_condition.rb', line 20

def check(data)
  data.is_a?(String) && compare_with_version(data)
end