Module: Roda::RodaPlugins::Unpoly::RequestMethods

Extended by:
Forwardable
Defined in:
lib/roda/plugins/unpoly.rb

Instance Method Summary collapse

Instance Method Details

#unpolyObject

Send the appropriate headers and cookies back to the client in order to satisfy the contract of the Unpoly library. Called early in your routing tree.



70
71
72
73
74
75
76
77
78
79
# File 'lib/roda/plugins/unpoly.rb', line 70

def unpoly
  response.headers["X-Up-Location"] = url
  response.headers["X-Up-Method"] = request_method

  if !get? && !unpoly?
    Rack::Utils.set_cookie_header!(response.headers, "_up_method", { value: request_method, path: "/" })
  else
    Rack::Utils.delete_cookie_header!(response.headers, "_up_method", { path: "/" })
  end
end

#upObject

An instance of the Inspector.



82
83
84
# File 'lib/roda/plugins/unpoly.rb', line 82

def up
  Inspector.new(self)
end