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:



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

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.



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

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.



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

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.



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

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.



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

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