Sha256: 5a25eb799587dc526cee06ff25f87a0beb964ede912cb21d398ad30378a6e52a

Contents?: true

Size: 562 Bytes

Versions: 18

Compression:

Stored size: 562 Bytes

Contents

# frozen_string_literal: true

module Appsignal
  module Rack
    # @api private
    class HanamiMiddleware < AbstractMiddleware
      def initialize(app, options = {})
        options[:params_method] = nil
        options[:instrument_event_name] ||= "process_action.hanami"
        super
      end

      private

      def add_transaction_metadata_after(transaction, request)
        transaction.add_params { params_for(request) }
      end

      def params_for(request)
        ::Hanami::Action.params_class.new(request.env).to_h
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
appsignal-4.1.3-java lib/appsignal/rack/hanami_middleware.rb
appsignal-4.1.3 lib/appsignal/rack/hanami_middleware.rb
appsignal-4.1.2-java lib/appsignal/rack/hanami_middleware.rb
appsignal-4.1.2 lib/appsignal/rack/hanami_middleware.rb
appsignal-4.1.1-java lib/appsignal/rack/hanami_middleware.rb
appsignal-4.1.1 lib/appsignal/rack/hanami_middleware.rb
appsignal-4.1.0-java lib/appsignal/rack/hanami_middleware.rb
appsignal-4.1.0 lib/appsignal/rack/hanami_middleware.rb
appsignal-4.0.9-java lib/appsignal/rack/hanami_middleware.rb
appsignal-4.0.9 lib/appsignal/rack/hanami_middleware.rb
appsignal-4.0.8-java lib/appsignal/rack/hanami_middleware.rb
appsignal-4.0.8 lib/appsignal/rack/hanami_middleware.rb
appsignal-4.0.7-java lib/appsignal/rack/hanami_middleware.rb
appsignal-4.0.7 lib/appsignal/rack/hanami_middleware.rb
appsignal-4.0.6-java lib/appsignal/rack/hanami_middleware.rb
appsignal-4.0.6 lib/appsignal/rack/hanami_middleware.rb
appsignal-4.0.5-java lib/appsignal/rack/hanami_middleware.rb
appsignal-4.0.5 lib/appsignal/rack/hanami_middleware.rb