Class: ClientInitializeHelpers::ResponseFormatter
- Inherits:
-
Object
- Object
- ClientInitializeHelpers::ResponseFormatter
- Extended by:
- T::Sig
- Defined in:
- lib/client_initialize_helpers.rb
Instance Method Summary collapse
- #get_responses(key) ⇒ Object
-
#initialize(evaluator, user, hash, client_sdk_key) ⇒ ResponseFormatter
constructor
A new instance of ResponseFormatter.
Constructor Details
#initialize(evaluator, user, hash, client_sdk_key) ⇒ ResponseFormatter
Returns a new instance of ResponseFormatter.
18 19 20 21 22 23 24 |
# File 'lib/client_initialize_helpers.rb', line 18 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
26 27 28 29 30 |
# File 'lib/client_initialize_helpers.rb', line 26 def get_responses(key) @specs[key] .map { |name, spec| to_response(name, spec) } .delete_if { |v| v.nil? }.to_h end |