Class: Orbit::Interceptors::Base

Inherits:
Rack::Response
  • Object
show all
Defined in:
lib/orbit/interceptors/base.rb

Class Method Summary collapse

Instance Method Summary collapse

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

#executeObject



14
15
16
17
18
# File 'lib/orbit/interceptors/base.rb', line 14

def execute
  @intercept = redirect(intercept, status)

  @intercept ? self : nil
end

#interceptObject

Raises:

  • (NotImplementedError)


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