Class: Kameleoon::Types::FeatureFlag

Inherits:
Object
  • Object
show all
Defined in:
lib/kameleoon/types/feature_flag.rb

Overview

FeatureFlag

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(variations, environment_enabled, rules, default_variation_key) ⇒ FeatureFlag

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



10
11
12
13
14
15
# File 'lib/kameleoon/types/feature_flag.rb', line 10

def initialize(variations, environment_enabled, rules, default_variation_key)
  @variations = variations
  @environment_enabled = environment_enabled
  @rules = rules
  @default_variation_key = default_variation_key
end

Instance Attribute Details

#default_variation_keyObject (readonly)

Returns the value of attribute default_variation_key.



7
8
9
# File 'lib/kameleoon/types/feature_flag.rb', line 7

def default_variation_key
  @default_variation_key
end

#environment_enabledObject (readonly)

Returns the value of attribute environment_enabled.



7
8
9
# File 'lib/kameleoon/types/feature_flag.rb', line 7

def environment_enabled
  @environment_enabled
end

#rulesObject (readonly)

Returns the value of attribute rules.



7
8
9
# File 'lib/kameleoon/types/feature_flag.rb', line 7

def rules
  @rules
end

#variationsObject (readonly)

Returns the value of attribute variations.



7
8
9
# File 'lib/kameleoon/types/feature_flag.rb', line 7

def variations
  @variations
end

Instance Method Details

#default_variationObject



17
18
19
# File 'lib/kameleoon/types/feature_flag.rb', line 17

def default_variation
  @variations[@default_variation_key]
end

#to_sObject



21
22
23
# File 'lib/kameleoon/types/feature_flag.rb', line 21

def to_s
  "FeatureFlag{variations:#{@variations},environment_enabled:#{@environment_enabled},rules:#{@rules},default_variation_key:#{@default_variation_key}}"
end