Sha256: cf0dbbcd670270dbfad5b31f708a08dbe0a76ae799daa39c92f2d67568fbebbb

Contents?: true

Size: 464 Bytes

Versions: 1

Compression:

Stored size: 464 Bytes

Contents

module Noder
  module HTTP
    module Listeners
      class NotFound < Events::Listeners::Base
        def call(env)
          callback.call(env) if callback
          response = env[:response]
          render_not_found(response) unless response.is_rendered?
          env
        end

        def render_not_found(response)
          response.status_code = 404
          response.write('Not Found')
          response.end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
noder-0.0.2 lib/noder/http/listeners/not_found.rb