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:



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

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.



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

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.



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

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.



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

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.



61
62
63
# File 'lib/kameleoon/targeting/condition.rb', line 61

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