Class: Kameleoon::Targeting::Condition Private

Inherits:
Object
  • Object
show all
Defined in:
lib/kameleoon/targeting/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.

Base class for all targeting conditions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json_condition) ⇒ Condition

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 Condition.

Raises:



52
53
54
55
56
57
# File 'lib/kameleoon/targeting/condition.rb', line 52

def initialize(json_condition)
  raise Exception::NotFound.new('targetingType'), 'targetingType missed' if json_condition['targetingType'].nil?

  @type = json_condition['targetingType']
  @include = json_condition['isInclude'].nil? ? true : json_condition['isInclude']
end

Instance Attribute Details

#includeObject (readonly)

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.



50
51
52
# File 'lib/kameleoon/targeting/condition.rb', line 50

def include
  @include
end

#typeObject (readonly)

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.



50
51
52
# File 'lib/kameleoon/targeting/condition.rb', line 50

def type
  @type
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.



59
60
61
# File 'lib/kameleoon/targeting/condition.rb', line 59

def check(_data)
  raise 'Abstract method `check` call'
end