@@ -36,18 +36,16 @@ class LDContext
3636 # @param kind [String, nil]
3737 # @param name [String, nil]
3838 # @param anonymous [Boolean, nil]
39- # @param secondary [String, nil]
4039 # @param attributes [Hash, nil]
4140 # @param private_attributes [Array<String>, nil]
4241 # @param error [String, nil]
4342 # @param contexts [Array<LDContext>, nil]
4443 #
45- def initialize ( key , kind , name = nil , anonymous = nil , secondary = nil , attributes = nil , private_attributes = nil , error = nil , contexts = nil )
44+ def initialize ( key , kind , name = nil , anonymous = nil , attributes = nil , private_attributes = nil , error = nil , contexts = nil )
4645 @key = key
4746 @kind = kind
4847 @name = name
4948 @anonymous = anonymous || false
50- @secondary = secondary
5149 @attributes = attributes
5250 @private_attributes = private_attributes
5351 @error = error
@@ -235,8 +233,6 @@ def individual_context(kind)
235233 @name
236234 when :anonymous
237235 @anonymous
238- when :secondary
239- @secondary
240236 else
241237 @attributes &.fetch ( name , nil )
242238 end
@@ -322,15 +318,15 @@ def self.create_multi(contexts)
322318
323319 return contexts [ 0 ] if contexts . length == 1
324320
325- new ( nil , "multi" , nil , false , nil , nil , nil , nil , contexts )
321+ new ( nil , "multi" , nil , false , nil , nil , nil , contexts )
326322 end
327323
328324 #
329325 # @param error [String]
330326 # @return [LDContext]
331327 #
332328 private_class_method def self . create_invalid_context ( error )
333- new ( nil , nil , nil , false , nil , nil , nil , error )
329+ new ( nil , nil , nil , false , nil , nil , error )
334330 end
335331
336332 #
@@ -376,7 +372,7 @@ def self.create_multi(contexts)
376372 return create_invalid_context ( "The provided private attributes are not an array" )
377373 end
378374
379- new ( key . to_s , KIND_DEFAULT , name , anonymous , data [ :secondary ] , attributes , private_attributes )
375+ new ( key . to_s , KIND_DEFAULT , name , anonymous , attributes , private_attributes )
380376 end
381377
382378 #
@@ -416,21 +412,18 @@ def self.create_multi(contexts)
416412
417413 # We only need to create an attribute hash if there are keys set outside
418414 # of the ones we store in dedicated instance variables.
419- #
420- # :secondary is not a supported top level key in the new schema.
421- # However, someone could still include it so we need to ignore it.
422415 attributes = nil
423416 data . each do |k , v |
424417 case k
425- when :kind , :key , :name , :anonymous , :secondary , : _meta
418+ when :kind , :key , :name , :anonymous , :_meta
426419 next
427420 else
428421 attributes ||= { }
429422 attributes [ k ] = v . clone
430423 end
431424 end
432425
433- new ( key . to_s , kind , name , anonymous , meta [ :secondary ] , attributes , private_attributes )
426+ new ( key . to_s , kind , name , anonymous , attributes , private_attributes )
434427 end
435428 end
436429end
0 commit comments