lib/apia/rack.rb
# Return a JSON-ready triplet for the given body.
#
# @param body [Hash, Array]
# @param status [Integer]
# @param headers [Hash]
# @return [Array]
Return a JSON-ready triplet for the given body.
Return a JSON - ready triplet for the given body .
def json_triplet(body, status: 200, headers: {})
        body_as_json = body.to_json
        [
          status,
          headers.merge('content-type' => 'application/json', 'content-length' => body_as_json.bytesize.to_s),
          [body_as_json]
        ]
      end
def json_triplet ( body , status : 200 , headers : { } ) body_as_json = body . to_json [ status , headers . merge ( 'content-type' => 'application/json' , 'content-length' => body_as_json . bytesize . to_s ) , [ body_as_json ] ] end
Return a JSON-ready triplet for the given body.
Return a JSON - ready triplet for the given body .
None
Array
body
<not_specific>
status
<not_specific>
headers
<not_specific>
<not_specific>
None