Class: FunctionalLightService::Context::ReservedKeysVerifier
- Inherits:
-
KeyVerifier
show all
- Defined in:
- lib/functional-light-service/context/key_verifier.rb
Instance Attribute Summary
Attributes inherited from KeyVerifier
#action, #context
Instance Method Summary
collapse
Methods inherited from KeyVerifier
#are_all_keys_in_context?, #format_keys, #initialize, #keys_not_found, #verify, verify_keys
Instance Method Details
#error_message ⇒ Object
96
97
98
99
|
# File 'lib/functional-light-service/context/key_verifier.rb', line 96
def error_message
"promised or expected keys cannot be a " \
"reserved key: [#{format_keys(violated_keys)}]"
end
|
101
102
103
|
# File 'lib/functional-light-service/context/key_verifier.rb', line 101
def keys
violated_keys
end
|
#reserved_keys ⇒ Object
113
114
115
|
# File 'lib/functional-light-service/context/key_verifier.rb', line 113
def reserved_keys
%i[message error_code current_action].freeze
end
|
#throw_error_predicate(keys) ⇒ Object
109
110
111
|
# File 'lib/functional-light-service/context/key_verifier.rb', line 109
def throw_error_predicate(keys)
keys.any?
end
|
#violated_keys ⇒ Object
92
93
94
|
# File 'lib/functional-light-service/context/key_verifier.rb', line 92
def violated_keys
(action.promised_keys + action.expected_keys) & reserved_keys
end
|