Class: ClientInitializeHelpers::ResponseFormatter

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

Instance Method Summary collapse

Constructor Details

#initialize(evaluator, user) ⇒ ResponseFormatter

Returns a new instance of ResponseFormatter.



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

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

Instance Method Details

#get_responses(key) ⇒ Object



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

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