Sha256: f956e41b25a8fbf879ee65102848651d9ebc599e26fe62722eb4752e5d351104

Contents?: true

Size: 417 Bytes

Versions: 7

Compression:

Stored size: 417 Bytes

Contents

# frozen_string_literal: true
module Browser
  class Middleware
    class Context
      attr_reader :browser, :request

      def initialize(request)
        @request = request

        @browser = Browser.new(
          request.user_agent,
          accept_language: request.env["HTTP_ACCEPT_LANGUAGE"]
        )
      end

      def redirect_to(path)
        throw :redirected, path.to_s
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/browser-2.3.0/lib/browser/middleware/context.rb
browser-2.3.0 lib/browser/middleware/context.rb
browser-2.2.0 lib/browser/middleware/context.rb
browser-2.1.0 lib/browser/middleware/context.rb
browser-2.0.3 lib/browser/middleware/context.rb
browser-2.0.2 lib/browser/middleware/context.rb
browser-2.0.1 lib/browser/middleware/context.rb