class RailsEventStore::Middleware

Public Class Methods

new(app) click to toggle source
# File lib/rails_event_store/middleware.rb, line 5
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/rails_event_store/middleware.rb, line 9
def call(env)
  if config.respond_to?(:event_store)
    config.event_store.with_request_metadata(env) { @app.call(env) }
  else
    @app.call(env)
  end
end

Private Instance Methods

config() click to toggle source
# File lib/rails_event_store/middleware.rb, line 19
def config
  Rails.application.config
end