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.
11 12 13 |
# File 'lib/redirectly/app.rb', line 11 def initialize(config_path) @config_path = config_path end |
Instance Attribute Details
#config_path ⇒ Object (readonly)
Returns the value of attribute config_path.
9 10 11 |
# File 'lib/redirectly/app.rb', line 9 def config_path @config_path end |
#req ⇒ Object (readonly)
Returns the value of attribute req.
9 10 11 |
# File 'lib/redirectly/app.rb', line 9 def req @req end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/redirectly/app.rb', line 15 def call(env) @req = Rack::Request.new env found = match if found redirect_to found else not_found end end |