Module: Rackr::Router::Endpoint
- Defined in:
- lib/rackr/router/endpoint.rb
Overview
A endpoint in Rackr is all objects that respond do .call, or .new.call
Class Method Summary collapse
Class Method Details
.call(endpoint, content, routes = nil, config = nil, error = nil) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rackr/router/endpoint.rb', line 7 def self.call(endpoint, content, routes = nil, config = nil, error = nil) instance = if endpoint.respond_to?(:call) endpoint elsif endpoint < Rackr::Action || endpoint < Rackr::Callback endpoint.new(routes:, config:) else endpoint.new end return instance.call(content, error) if error instance.call(content) end |