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
99
100
101
102
|
# File 'lib/functional-light-service/context/key_verifier.rb', line 99
def error_message
"promised or expected keys cannot be a " \
"reserved key: [#{format_keys(violated_keys)}]"
end
|
104
105
106
|
# File 'lib/functional-light-service/context/key_verifier.rb', line 104
def keys
violated_keys
end
|
#reserved_keys ⇒ Object
116
117
118
119
120
121
|
# File 'lib/functional-light-service/context/key_verifier.rb', line 116
def reserved_keys
%i[message error_code current_action
_aliases _before_actions _after_actions].freeze
end
|
#throw_error_predicate(keys) ⇒ Object
112
113
114
|
# File 'lib/functional-light-service/context/key_verifier.rb', line 112
def throw_error_predicate(keys)
keys.any?
end
|
#violated_keys ⇒ Object
95
96
97
|
# File 'lib/functional-light-service/context/key_verifier.rb', line 95
def violated_keys
(action.promised_keys + action.expected_keys) & reserved_keys
end
|