Module: ReamazeAPI::Utils
- Extended by:
- Utils
- Included in:
- Utils
- Defined in:
- lib/reamaze_api/utils.rb,
lib/reamaze_api/utils/hash_keys.rb
Defined Under Namespace
Modules: HashKeys
Instance Method Summary collapse
-
#error_hash(exception) ⇒ Object
Hash used for error responses.
-
#symbolize_hash(hash) ⇒ Object
Deep-symbolize keys in the given Hash.
Instance Method Details
#error_hash(exception) ⇒ Object
Hash used for error responses.
21 22 23 24 25 26 27 28 29 |
# File 'lib/reamaze_api/utils.rb', line 21 def error_hash(exception) { success: false, payload: { error: exception.class.name, message: exception. } } end |
#symbolize_hash(hash) ⇒ Object
Deep-symbolize keys in the given Hash.
12 13 14 |
# File 'lib/reamaze_api/utils.rb', line 12 def symbolize_hash(hash) HashKeys.deep_symbolize_keys(hash) end |