Class: ClientInitializeHelpers::ResponseFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/client_initialize_helpers.rb

Instance Method Summary collapse

Constructor Details

#initialize(evaluator, user, hash, client_sdk_key) ⇒ ResponseFormatter

Returns a new instance of ResponseFormatter.



15
16
17
18
19
20
21
# File 'lib/client_initialize_helpers.rb', line 15

def initialize(evaluator, user, hash, client_sdk_key)
  @evaluator = evaluator
  @user = user
  @specs = evaluator.spec_store.get_raw_specs
  @hash = hash
  @client_sdk_key = client_sdk_key
end

Instance Method Details

#get_responses(key) ⇒ Object



23
24
25
26
27
# File 'lib/client_initialize_helpers.rb', line 23

def get_responses(key)
  @specs[key]
    .map { |name, spec| to_response(name, spec) }
    .delete_if { |v| v.nil? }.to_h
end