Class: Orbit::Interceptors::Base
- Inherits:
-
Rack::Response
- Object
- Rack::Response
- Orbit::Interceptors::Base
- Defined in:
- lib/orbit/interceptors/base.rb
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(request) ⇒ Base
constructor
A new instance of Base.
- #intercept ⇒ Object
Constructor Details
#initialize(request) ⇒ Base
Returns a new instance of Base.
4 5 6 7 8 |
# File 'lib/orbit/interceptors/base.rb', line 4 def initialize(request) super() @request = request @status = 302 end |
Class Method Details
.execute(request) ⇒ Object
10 11 12 |
# File 'lib/orbit/interceptors/base.rb', line 10 def self.execute(request) new(request).execute end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 |
# File 'lib/orbit/interceptors/base.rb', line 14 def execute @intercept = redirect(intercept, status) @intercept ? self : nil end |
#intercept ⇒ Object
20 21 22 |
# File 'lib/orbit/interceptors/base.rb', line 20 def intercept raise NotImplementedError.new("#intercept method must be implemented on #{self.class.name}") end |