Class: Rack::PactBroker::HalBrowserRedirect
- Inherits:
-
Object
- Object
- Rack::PactBroker::HalBrowserRedirect
- Includes:
- PactBroker::Api::Paths
- Defined in:
- lib/rack/pact_broker/hal_browser_redirect.rb
Constant Summary
Constants included from PactBroker::Api::Paths
PactBroker::Api::Paths::CAN_I_DEPLOY_BADGE_PATH, PactBroker::Api::Paths::MATRIX_BADGE_PATH, PactBroker::Api::Paths::PACT_BADGE_PATH, PactBroker::Api::Paths::VERIFICATION_RESULTS
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}, &block) ⇒ HalBrowserRedirect
constructor
A new instance of HalBrowserRedirect.
Methods included from PactBroker::Api::Paths
#is_badge_path?, #is_verification_results_path?
Constructor Details
#initialize(app, options = {}, &block) ⇒ HalBrowserRedirect
Returns a new instance of HalBrowserRedirect.
10 11 12 |
# File 'lib/rack/pact_broker/hal_browser_redirect.rb', line 10 def initialize(app, = {}, &block) @app = app end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/rack/pact_broker/hal_browser_redirect.rb', line 14 def call(env) if redirect?(env) return [303, {'Location' => hal_browser_url_from_request(env)}, []] else app.call(env) end end |