@@ -36,18 +36,16 @@ class LDContext
36
36
# @param kind [String, nil]
37
37
# @param name [String, nil]
38
38
# @param anonymous [Boolean, nil]
39
- # @param secondary [String, nil]
40
39
# @param attributes [Hash, nil]
41
40
# @param private_attributes [Array<String>, nil]
42
41
# @param error [String, nil]
43
42
# @param contexts [Array<LDContext>, nil]
44
43
#
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 )
46
45
@key = key
47
46
@kind = kind
48
47
@name = name
49
48
@anonymous = anonymous || false
50
- @secondary = secondary
51
49
@attributes = attributes
52
50
@private_attributes = private_attributes
53
51
@error = error
@@ -235,8 +233,6 @@ def individual_context(kind)
235
233
@name
236
234
when :anonymous
237
235
@anonymous
238
- when :secondary
239
- @secondary
240
236
else
241
237
@attributes &.fetch ( name , nil )
242
238
end
@@ -322,15 +318,15 @@ def self.create_multi(contexts)
322
318
323
319
return contexts [ 0 ] if contexts . length == 1
324
320
325
- new ( nil , "multi" , nil , false , nil , nil , nil , nil , contexts )
321
+ new ( nil , "multi" , nil , false , nil , nil , nil , contexts )
326
322
end
327
323
328
324
#
329
325
# @param error [String]
330
326
# @return [LDContext]
331
327
#
332
328
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 )
334
330
end
335
331
336
332
#
@@ -376,7 +372,7 @@ def self.create_multi(contexts)
376
372
return create_invalid_context ( "The provided private attributes are not an array" )
377
373
end
378
374
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 )
380
376
end
381
377
382
378
#
@@ -416,21 +412,18 @@ def self.create_multi(contexts)
416
412
417
413
# We only need to create an attribute hash if there are keys set outside
418
414
# 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.
422
415
attributes = nil
423
416
data . each do |k , v |
424
417
case k
425
- when :kind , :key , :name , :anonymous , :secondary , : _meta
418
+ when :kind , :key , :name , :anonymous , :_meta
426
419
next
427
420
else
428
421
attributes ||= { }
429
422
attributes [ k ] = v . clone
430
423
end
431
424
end
432
425
433
- new ( key . to_s , kind , name , anonymous , meta [ :secondary ] , attributes , private_attributes )
426
+ new ( key . to_s , kind , name , anonymous , attributes , private_attributes )
434
427
end
435
428
end
436
429
end
0 commit comments