Method: Hanami::API::Block::Context#body

Defined in:
lib/hanami/api/block/context.rb

#bodyString #body(value) ⇒ Object

Overloads:

  • #bodyString

    Gets the current HTTP response body

    Returns:

    • the HTTP body

  • #body(value) ⇒ Object

    Sets the HTTP body

    Parameters:

    • the HTTP response body

Since:

  • 0.1.0



22
23
24
25
26
27
28
# File 'lib/hanami/api/block/context.rb', line 22

def body(value = nil)
  if value
    @body = value
  else
    @body
  end
end