Class: Browsernizer::Router
- Inherits:
-
Object
- Object
- Browsernizer::Router
- Defined in:
- lib/browsernizer/router.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) {|@config| ... } ⇒ Router
constructor
A new instance of Router.
Constructor Details
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config
4 5 6 |
# File 'lib/browsernizer/router.rb', line 4 def config @config end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/browsernizer/router.rb', line 12 def call(env) raw_browser, browser = get_browsers(env) env["browsernizer"] = { "supported" => supported?(raw_browser, browser), "browser" => browser.name.to_s, "version" => browser.version.to_s } redirect_request(env) || @app.call(env) end |