Module: LightService::ValidatedContext::ExpectedKeyVerifier

Included in:
Context::ExpectedKeyVerifier
Defined in:
lib/light_service/validated_context/expected_key_verifier.rb

Instance Method Summary collapse

Instance Method Details

#keysObject



6
7
8
# File 'lib/light_service/validated_context/expected_key_verifier.rb', line 6

def keys
  keys_as_symbols
end

#keys_as_symbolsObject



10
11
12
13
14
15
16
# File 'lib/light_service/validated_context/expected_key_verifier.rb', line 10

def keys_as_symbols
  action.expected_keys.map do |key|
    next key unless key.is_a?(LightService::Context::ValidatedKey)

    key.to_sym
  end
end

#raw_keysObject



18
19
20
# File 'lib/light_service/validated_context/expected_key_verifier.rb', line 18

def raw_keys
  action.expected_keys
end

#throw_error_predicate(_keys) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/light_service/validated_context/expected_key_verifier.rb', line 22

def throw_error_predicate(_keys)
  type_check_and_coerce_keys!(raw_keys)

  return false if are_all_keys_valid?

  should_throw_on_validation_error?
end