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:



55
56
57
58
59
60
61
# File 'lib/kameleoon/targeting/condition.rb', line 55

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

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

Instance Attribute Details

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



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

def id
  @id
end

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



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

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.



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

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.



63
64
65
# File 'lib/kameleoon/targeting/condition.rb', line 63

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