class Rack::App::Endpoint

Attributes

config[R]

Public Class Methods

new(properties) click to toggle source
# File lib/rack/app/endpoint.rb, line 14
def initialize(properties)
  @config = Rack::App::Endpoint::Config.new(properties)
end

Public Instance Methods

call(env) click to toggle source
# File lib/rack/app/endpoint.rb, line 26
def call(env)
  to_app.call(env)
end
fork(differences_in_properties) click to toggle source
# File lib/rack/app/endpoint.rb, line 18
def fork(differences_in_properties)
  self.class.new(self.properties.merge(differences_in_properties))
end
properties() click to toggle source
# File lib/rack/app/endpoint.rb, line 22
def properties
  @config.to_hash
end
rack_app?() click to toggle source
# File lib/rack/app/endpoint.rb, line 37
def rack_app?
  !!@config.app_class
rescue
  false
end
to_app() click to toggle source
# File lib/rack/app/endpoint.rb, line 30
def to_app
  # TODO: fix this to cache it, but to that you need to resolve the problem when middlewares added,
  # old endpoints are not refreshed by the middleware configs
  # router.reset must be checked
  self.class::Builder.new(@config).to_app
end