Sha256: c920961ee3a6019939cf168930234cf515351373818499cd96bfea9170ada236

Contents?: true

Size: 721 Bytes

Versions: 21

Compression:

Stored size: 721 Bytes

Contents

module Hanami
  # @api private
  module Routing
    # The default Rack application that responds when a resource cannot be found.
    #
    # @since 0.1.0
    # @api private
    class Default
      # @api private
      DEFAULT_CODE = 404
      # @api private
      DEFAULT_BODY = ['Not Found'].freeze
      # @api private
      CONTENT_TYPE = 'Content-Type'.freeze

      # @api private
      class NullAction
        include Hanami::Action

        # @api private
        def call(env)
        end
      end

      # @api private
      def call(env)
        action = NullAction.new.tap { |a| a.call(env) }
        [ DEFAULT_CODE, {CONTENT_TYPE => action.content_type}, DEFAULT_BODY, action ]
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
hanami-1.3.5 lib/hanami/routing/default.rb
hanami-1.3.4 lib/hanami/routing/default.rb
hanami-1.3.3 lib/hanami/routing/default.rb
hanami-1.3.2 lib/hanami/routing/default.rb
hanami-1.3.1 lib/hanami/routing/default.rb
hanami-1.3.0 lib/hanami/routing/default.rb
hanami-1.3.0.beta1 lib/hanami/routing/default.rb
hanami-1.2.0 lib/hanami/routing/default.rb
hanami-1.2.0.rc2 lib/hanami/routing/default.rb
hanami-1.2.0.rc1 lib/hanami/routing/default.rb
hanami-1.2.0.beta2 lib/hanami/routing/default.rb
hanami-1.2.0.beta1 lib/hanami/routing/default.rb
hanami-1.1.1 lib/hanami/routing/default.rb
hanami-1.1.0 lib/hanami/routing/default.rb
hanami-1.1.0.rc1 lib/hanami/routing/default.rb
hanami-1.1.0.beta3 lib/hanami/routing/default.rb
hanami-1.1.0.beta2 lib/hanami/routing/default.rb
hanami-1.1.0.beta1 lib/hanami/routing/default.rb
hanami-1.0.0 lib/hanami/routing/default.rb
hanami-1.0.0.rc1 lib/hanami/routing/default.rb