module Roda::RodaPlugins::Path::InstanceMethods

def path(obj, *args, &block)

:add_script_name option is true, this prepends the SCRIPT_NAME to the path.
had its class previously registered with the application. If the app's
Return a path based on the class of the object. The object passed must have
def path(obj, *args, &block)
  app = self.class
  opts = app.opts
  klass =  opts[:path_class_by_name] ? obj.class.name : obj.class
  unless meth = opts[:path_class_methods][klass]
    raise RodaError, "unrecognized object given to Roda#path: #{obj.inspect}"
  end
  path = send(meth, obj, *args, &block)
  path = request.script_name.to_s + path if opts[:add_script_name]
  path
end