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.
15 16 17 |
# File 'lib/brauser/hooks.rb', line 15 def self.included(base) base.send(:helper_method, :browser) end |
Instance Method Details
- (Browser) browser(force = false)
Detects the current browser.
23 24 25 26 |
# File 'lib/brauser/hooks.rb', line 23 def browser(force = false) @browser = nil if force @browser ||= Browser.new(request.headers["User-Agent"], request.headers["Accept-Language"]) end |