Class: Toolchest::App
- Inherits:
-
Object
- Object
- Toolchest::App
- Defined in:
- lib/toolchest/app.rb
Overview
Instance Attribute Summary collapse
-
#mount_key ⇒ Object
readonly
Returns the value of attribute mount_key.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(mount_key = :default) ⇒ App
constructor
A new instance of App.
Constructor Details
#initialize(mount_key = :default) ⇒ App
Returns a new instance of App.
12 13 14 15 |
# File 'lib/toolchest/app.rb', line 12 def initialize(mount_key = :default) @mount_key = mount_key.to_sym @router = build_action_dispatch_router end |
Instance Attribute Details
#mount_key ⇒ Object (readonly)
Returns the value of attribute mount_key.
10 11 12 |
# File 'lib/toolchest/app.rb', line 10 def mount_key @mount_key end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/toolchest/app.rb', line 17 def call(env) Engine.ensure_initialized! env["toolchest.mount_key"] = @mount_key.to_s cfg = Toolchest.configuration(@mount_key) if cfg.mount_path.nil? && env["SCRIPT_NAME"].present? cfg.mount_path = env["SCRIPT_NAME"] end @router.call(env) end |