| 
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 | # File 'lib/determinator/serializers/json.rb', line 11
def load(string_or_hash)
  obj = string_or_hash.is_a?(Hash) ? string_or_hash : ::JSON.parse(string_or_hash)
  Determinator::Feature.new(
    name:                 obj['name'],
    identifier:           obj['identifier'],
    bucket_type:          obj['bucket_type'],
    structured_bucket:    obj['structured_bucket'],
    active:               (obj['active'] === true),
    target_groups:        obj['target_groups'],
    fixed_determinations: obj['fixed_determinations'].to_a,
    variants:             obj['variants'].to_h,
    overrides:            obj['overrides'].to_h,
    winning_variant:      obj['winning_variant'].to_s,
  )
end |