Module: SpobBrowserDetector::Rails::ViewHelpers
- Defined in:
- lib/spob_browser_detector/rails/view_helpers.rb
Instance Method Summary collapse
-
#g_browser_full_name ⇒ Object
Returns the full browser name.
-
#g_browser_id ⇒ Object
Returns the browser name concatenated with the browser version.
-
#g_browser_is?(options = {}) ⇒ Boolean
Returns true if the browser matches the options ent in, otherwise returns false.
-
#g_browser_name ⇒ Object
Returns the name of the browser that is making this request.
-
#g_browser_version ⇒ Object
Returns the version of the browser that is making this request.
Instance Method Details
#g_browser_full_name ⇒ Object
Returns the full browser name. For example, ‘Internet Explorer 7.0’.
25 26 27 28 |
# File 'lib/spob_browser_detector/rails/view_helpers.rb', line 25 def g_browser_full_name setup_detector @g_browser_detector.browser_full_name end |
#g_browser_id ⇒ Object
Returns the browser name concatenated with the browser version. for example, ‘ie7’. When using the browser detector in the contoller you may put a :g_browser_detector variabe in the session if you wish to keep the BrowserDetector from being instantiated more than once per request.
34 35 36 37 |
# File 'lib/spob_browser_detector/rails/view_helpers.rb', line 34 def g_browser_id setup_detector @g_browser_detector.browser_id end |
#g_browser_is?(options = {}) ⇒ Boolean
Returns true if the browser matches the options ent in, otherwise returns false. When using the browser detector in the contoller you may put a :g_browser_detector variable in the session if you wish to keep the Detector from being instantiated more than once per request.
Options
-
:name
- The name of the browser. For example ‘ie’. -
:version
- The version of the browser. For example ‘7’.
47 48 49 50 |
# File 'lib/spob_browser_detector/rails/view_helpers.rb', line 47 def g_browser_is?( ={} ) setup_detector @g_browser_detector.browser_is?( ) end |
#g_browser_name ⇒ Object
Returns the name of the browser that is making this request. For example ‘ie’. When using the browser detector in the contoller you may put a :g_browser_detector variabe in the session if you wish to keep the BrowserDetector from being instantiated more than once per request.
9 10 11 12 |
# File 'lib/spob_browser_detector/rails/view_helpers.rb', line 9 def g_browser_name setup_detector @g_browser_detector.browser_name end |
#g_browser_version ⇒ Object
Returns the version of the browser that is making this request. For example ‘7’. When using the browser detector in the contoller you may put a :g_browser_detector variabe in the session if you wish to keep the BrowserDetector from being instantiated more than once per request.
18 19 20 21 |
# File 'lib/spob_browser_detector/rails/view_helpers.rb', line 18 def g_browser_version setup_detector @g_browser_detector.browser_version end |