Sha256: 159c4f8cde4d226d83a84ff48cc0149ff71ac5ae963cee220386ed19fc52fed5

Contents?: true

Size: 576 Bytes

Versions: 10

Compression:

Stored size: 576 Bytes

Contents

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

      class NullAction
        include Hanami::Action

        def call(env)
        end
      end

      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

10 entries across 10 versions & 1 rubygems

Version Path
hanami-1.0.0.beta2 lib/hanami/routing/default.rb
hanami-1.0.0.beta1 lib/hanami/routing/default.rb
hanami-0.9.2 lib/hanami/routing/default.rb
hanami-0.9.1 lib/hanami/routing/default.rb
hanami-0.9.0 lib/hanami/routing/default.rb
hanami-0.8.0 lib/hanami/routing/default.rb
hanami-0.7.3 lib/hanami/routing/default.rb
hanami-0.7.2 lib/hanami/routing/default.rb
hanami-0.7.1 lib/hanami/routing/default.rb
hanami-0.7.0 lib/hanami/routing/default.rb