Class: Shaf::Responder::ProblemJson
- Defined in:
- lib/shaf/responder/problem_json.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
#controller, #options, #resource
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
#build_response, call, #initialize, #lookup_rel, mime_type, #preload_links, #serialized_hash, use_as_default!
Constructor Details
This class inherits a constructor from Shaf::Responder::Base
Class Method Details
.can_handle?(resource) ⇒ Boolean
6 7 8 9 |
# File 'lib/shaf/responder/problem_json.rb', line 6 def self.can_handle?(resource) klass = resource.is_a?(Class) ? resource : resource.class klass <= StandardError end |
Instance Method Details
#body ⇒ Object
11 12 13 |
# File 'lib/shaf/responder/problem_json.rb', line 11 def body JSON.generate(hash) end |