Sha256: 3105b22f25248a47e6e4e239b540f1869584eb53c1ce0b9ec62ad2bf73b87cdf

Contents?: true

Size: 390 Bytes

Versions: 19

Compression:

Stored size: 390 Bytes

Contents

class Browser
  class Middleware
    class Context
      attr_reader :browser, :request

      def initialize(request)
        @request = request

        @browser = Browser.new(
          ua: 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

19 entries across 19 versions & 2 rubygems

Version Path
browser-1.1.0 lib/browser/middleware/context.rb
browser2-1.0.0 lib/browser/middleware/context.rb
browser-1.0.1 lib/browser/middleware/context.rb
browser-1.0.0 lib/browser/middleware/context.rb
browser-0.9.1 lib/browser/middleware/context.rb
browser-0.9.0 lib/browser/middleware/context.rb
browser-0.8.0 lib/browser/middleware/context.rb
browser-0.7.2 lib/browser/middleware/context.rb
browser-0.7.1 lib/browser/middleware/context.rb
browser-0.7.0 lib/browser/middleware/context.rb
browser-0.6.0 lib/browser/middleware/context.rb
browser-0.5.0 lib/browser/middleware/context.rb
browser-0.4.1 lib/browser/middleware/context.rb
browser-0.4.0 lib/browser/middleware/context.rb
browser-0.3.2 lib/browser/middleware/context.rb
browser-0.3.1 lib/browser/middleware/context.rb
browser-0.3.0 lib/browser/middleware/context.rb
browser-0.2.1 lib/browser/middleware/context.rb
browser-0.2.0 lib/browser/middleware/context.rb