Top Level Namespace

Defined Under Namespace

Modules: LaunchDarkly

Instance Method Summary collapse

Instance Method Details

#check_variation_range(flag, errors_out, variation, description) ⇒ Object

See serialization.rb for implementation notes on the data model classes.



7
8
9
10
11
12
13
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 7

def check_variation_range(flag, errors_out, variation, description)
  unless flag.nil? || errors_out.nil? || variation.nil?
    if variation < 0 || variation >= flag.variations.length
      errors_out << "#{description} has invalid variation index"
    end
  end
end