Class: Featureflip::Models::FlagConfiguration

Inherits:
Struct
  • Object
show all
Defined in:
lib/featureflip/models/flag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, version:, type:, enabled:, variations:, rules:, fallthrough:, off_variation:, prerequisites: []) ⇒ FlagConfiguration

Returns a new instance of FlagConfiguration.



37
38
39
# File 'lib/featureflip/models/flag.rb', line 37

def initialize(key:, version:, type:, enabled:, variations:, rules:, fallthrough:, off_variation:, prerequisites: [])
  super
end

Instance Attribute Details

#enabledObject

Returns the value of attribute enabled

Returns:

  • (Object)

    the current value of enabled



33
34
35
# File 'lib/featureflip/models/flag.rb', line 33

def enabled
  @enabled
end

#fallthroughObject

Returns the value of attribute fallthrough

Returns:

  • (Object)

    the current value of fallthrough



33
34
35
# File 'lib/featureflip/models/flag.rb', line 33

def fallthrough
  @fallthrough
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



33
34
35
# File 'lib/featureflip/models/flag.rb', line 33

def key
  @key
end

#off_variationObject

Returns the value of attribute off_variation

Returns:

  • (Object)

    the current value of off_variation



33
34
35
# File 'lib/featureflip/models/flag.rb', line 33

def off_variation
  @off_variation
end

#prerequisitesObject

Returns the value of attribute prerequisites

Returns:

  • (Object)

    the current value of prerequisites



33
34
35
# File 'lib/featureflip/models/flag.rb', line 33

def prerequisites
  @prerequisites
end

#rulesObject

Returns the value of attribute rules

Returns:

  • (Object)

    the current value of rules



33
34
35
# File 'lib/featureflip/models/flag.rb', line 33

def rules
  @rules
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



33
34
35
# File 'lib/featureflip/models/flag.rb', line 33

def type
  @type
end

#variationsObject

Returns the value of attribute variations

Returns:

  • (Object)

    the current value of variations



33
34
35
# File 'lib/featureflip/models/flag.rb', line 33

def variations
  @variations
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



33
34
35
# File 'lib/featureflip/models/flag.rb', line 33

def version
  @version
end

Instance Method Details

#get_variation(key) ⇒ Object



41
42
43
44
# File 'lib/featureflip/models/flag.rb', line 41

def get_variation(key)
  @variations_by_key ||= variations.each_with_object({}) { |v, h| h[v.key] = v }
  @variations_by_key[key]
end