Class: Shaf::Parser::Json
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
inherited, #initialize, mime_type
Constructor Details
This class inherits a constructor from Shaf::Parser::Base
Class Method Details
.can_handle?(request) ⇒ Boolean
7 8 9 |
# File 'lib/shaf/parser/json.rb', line 7 def self.can_handle?(request) request.content_type&.match? %r{application/(.*\+)?json} end |
Instance Method Details
#call ⇒ Object
11 12 13 |
# File 'lib/shaf/parser/json.rb', line 11 def call @payload ||= parse_json end |