Sha256: affb85012a693eb942ea56581d18c4d7ef88f7aed11aec2663ecec5a2a79d2fb

Contents?: true

Size: 411 Bytes

Versions: 16

Compression:

Stored size: 411 Bytes

Contents

# frozen_string_literal: true

require "action_controller/railtie"

module Browser
  module ActionController
    extend ActiveSupport::Concern

    included do
      helper_method(:browser) if respond_to?(:helper_method)
    end

    private def browser
      @browser ||= Browser.new(
        request.headers["User-Agent"],
        accept_language: request.headers["Accept-Language"]
      )
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
browser-6.2.0 lib/browser/action_controller.rb
browser-6.1.0 lib/browser/action_controller.rb
browser-6.0.0 lib/browser/action_controller.rb
browser-5.3.1 lib/browser/action_controller.rb
browser-5.3.0 lib/browser/action_controller.rb
browser-5.2.0 lib/browser/action_controller.rb
browser-5.1.0 lib/browser/action_controller.rb
browser-5.0.0 lib/browser/action_controller.rb
browser-4.2.0 lib/browser/action_controller.rb
browser-4.1.0 lib/browser/action_controller.rb
browser-4.0.0 lib/browser/action_controller.rb
browser-3.0.3 lib/browser/action_controller.rb
browser-3.0.2 lib/browser/action_controller.rb
browser-3.0.1 lib/browser/action_controller.rb
browser-3.0.0 lib/browser/action_controller.rb
browser-2.7.1 lib/browser/action_controller.rb