Class: Rack::PactBroker::StoreBaseURL
- Inherits:
-
Object
- Object
- Rack::PactBroker::StoreBaseURL
- Defined in:
- lib/rack/pact_broker/store_base_url.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ StoreBaseURL
constructor
A new instance of StoreBaseURL.
Constructor Details
#initialize(app) ⇒ StoreBaseURL
Returns a new instance of StoreBaseURL.
4 5 6 |
# File 'lib/rack/pact_broker/store_base_url.rb', line 4 def initialize app @app = app end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 |
# File 'lib/rack/pact_broker/store_base_url.rb', line 8 def call(env) Thread.current[:pact_broker_thread_data].base_url ||= (ENV['PACT_BROKER_BASE_URL'] || ::Rack::Request.new(env).base_url) @app.call(env) end |