Class: TurbolinksRender::Middleware::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/turbolinks_render/middleware.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#headersObject

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



13
14
15
# File 'lib/turbolinks_render/middleware.rb', line 13

def headers
  @headers
end

#responseObject

Returns the value of attribute response

Returns:

  • (Object)

    the current value of response



13
14
15
# File 'lib/turbolinks_render/middleware.rb', line 13

def response
  @response
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



13
14
15
# File 'lib/turbolinks_render/middleware.rb', line 13

def status
  @status
end

Instance Method Details

#candidate_for_turbolinks?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/turbolinks_render/middleware.rb', line 14

def candidate_for_turbolinks?
  html_response? && !empty?
end


18
19
20
# File 'lib/turbolinks_render/middleware.rb', line 18

def turbolinks_body
  @turbolinks_body ||= js_code_to_render_html(body)
end