Class: ClientInitializeHelpers::ResponseFormatter

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
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.



11
12
13
14
15
16
17
# File 'lib/client_initialize_helpers.rb', line 11

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



19
20
21
22
23
# File 'lib/client_initialize_helpers.rb', line 19

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