Class: Kameleoon::Targeting::Condition Private

Inherits:
Object
  • Object
show all
Defined in:
lib/kameleoon/targeting/condition.rb

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.

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.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/kameleoon/targeting/condition.rb', line 9

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

  @type = json_condition['targetingType']

  if json_condition['include'].nil? && json_condition['isInclude'].nil?
    raise Exception::NotFoundError.new('include / isInclude missed'), 'include / isInclude missed'
  end

  @include = json_condition['include'] || json_condition['isInclude']
end

Instance Attribute Details

#includeObject

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.



7
8
9
# File 'lib/kameleoon/targeting/condition.rb', line 7

def include
  @include
end

#typeObject

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.



7
8
9
# File 'lib/kameleoon/targeting/condition.rb', line 7

def type
  @type
end

Instance Method Details

#check(conditions) ⇒ 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.



23
24
25
# File 'lib/kameleoon/targeting/condition.rb', line 23

def check(conditions)
  raise "Todo: Implement check method in condition"
end