lib/hanami/routing/endpoint_resolver.rb in hanami-router-0.6.2 vs lib/hanami/routing/endpoint_resolver.rb in hanami-router-0.7.0
- old
+ new
@@ -12,10 +12,14 @@
class EndpointResolver
# @since 0.2.0
# @api private
NAMING_PATTERN = '%{controller}::%{action}'.freeze
+ # @since 0.7.0
+ # @api private
+ DEFAULT_RESPONSE = [404, {'X-Cascade' => 'pass'}, 'Not Found'].freeze
+
# Default separator for controller and action.
# A different separator can be passed to #initialize with the `:separator` option.
#
# @see #initialize
# @see #resolve
@@ -46,11 +50,11 @@
# to return an action name. This string SHOULD contain
# <tt>'%{controller}'</tt> and <tt>'%{action}'</tt>, all the other keys
# will be ignored.
# See the examples below.
#
- # @option options [String] :action_separator the sepatator between controller and
+ # @option options [String] :action_separator the separator between controller and
# action name. (defaults to `ACTION_SEPARATOR`)
#
# @return [Hanami::Routing::EndpointResolver] self
#
# @since 0.1.0
@@ -176,10 +180,10 @@
end
protected
def default
@endpoint_class.new(
- ->(env) { [404, {'X-Cascade' => 'pass'}, 'Not Found'] }
+ ->(env) { DEFAULT_RESPONSE }
)
end
def constantize(string)
klass = Utils::Class.load!(string, @namespace)