class Hanami::Routing::Endpoint
Routing
endpoint This is the object that responds to an HTTP request made against a certain path.
The router will use this class for:
* Procs and any Rack compatible object (respond to #call)
@since 0.1.0
@api private
@example
require 'hanami/router' Hanami::Router.new do get '/proc', to: ->(env) { [200, {}, ['This will use Hanami::Routing::Endpoint']] } get '/rack-app', to: RackApp.new end
Public Instance Methods
destination_path()
click to toggle source
@since 1.0.1 @api private
# File lib/hanami/routing/endpoint.rb, line 65 def destination_path end
inspect()
click to toggle source
@since 0.2.0 @api private
# File lib/hanami/routing/endpoint.rb, line 36 def inspect case __getobj__ when Proc source, line = __getobj__.source_location lambda_inspector = " (lambda)" if __getobj__.lambda? "#<Proc@#{ ::File.expand_path(source) }:#{ line }#{ lambda_inspector }>" when Class __getobj__ else "#<#{ __getobj__.class }>" end end
redirect?()
click to toggle source
@since 1.0.1 @api private
# File lib/hanami/routing/endpoint.rb, line 59 def redirect? false end
routable?()
click to toggle source
@since 1.0.0 @api private
# File lib/hanami/routing/endpoint.rb, line 52 def routable? !__getobj__.nil? rescue ArgumentError end