Module: Brauser::Hooks::RubyOnRails
- Defined in:
- lib/brauser/hooks.rb
Overview
Hook for integration with Ruby on Rails.
Class Method Summary (collapse)
-
+ (Object) included(base)
Includes brauser in ActionController.
Instance Method Summary (collapse)
-
- (Browser) browser(force = false)
Detects the current browser.
Class Method Details
+ (Object) included(base)
Includes brauser in ActionController.
14 15 16 |
# File 'lib/brauser/hooks.rb', line 14 def self.included(base) base.send(:helper_method, :browser) end |
Instance Method Details
- (Browser) browser(force = false)
Detects the current browser.
22 23 24 25 |
# File 'lib/brauser/hooks.rb', line 22 def browser(force = false) @browser = nil if force @browser ||= ::Brauser::Browser.new(request.headers["User-Agent"], request.headers["Accept-Language"]) end |