Class: Redirectly::App
- Inherits:
-
Object
- Object
- Redirectly::App
- Defined in:
- lib/redirectly/app.rb
Instance Attribute Summary collapse
-
#config_path ⇒ Object
readonly
Returns the value of attribute config_path.
-
#req ⇒ Object
readonly
Returns the value of attribute req.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(config_path) ⇒ App
constructor
A new instance of App.
Constructor Details
#initialize(config_path) ⇒ App
Returns a new instance of App.
13 14 15 |
# File 'lib/redirectly/app.rb', line 13 def initialize(config_path) @config_path = config_path end |
Instance Attribute Details
#config_path ⇒ Object (readonly)
Returns the value of attribute config_path.
11 12 13 |
# File 'lib/redirectly/app.rb', line 11 def config_path @config_path end |
#req ⇒ Object (readonly)
Returns the value of attribute req.
11 12 13 |
# File 'lib/redirectly/app.rb', line 11 def req @req end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/redirectly/app.rb', line 17 def call(env) @req = Rack::Request.new env found = find_match if found handle_target found else not_found end end |