Sha256: dcac72fe88c58c8d3c8ebfe1754121419ce6d8ac88fa0e3ca443a61f17561944

Contents?: true

Size: 322 Bytes

Versions: 5

Compression:

Stored size: 322 Bytes

Contents

module Trice
  module ControllerMethods
    class RawReferenceTime
      ENV_KEY = 'trice.raw_reference_time'.freeze

      def initialize(app)
        @app = app
      end

      def call(env)
        env[ENV_KEY] = Time.now

        Trice.with_reference_time(env[ENV_KEY]) { @app.call(env) }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
trice-0.3.2 lib/trice/controller_methods/raw_reference_time.rb
trice-0.3.1 lib/trice/controller_methods/raw_reference_time.rb
trice-0.3.0 lib/trice/controller_methods/raw_reference_time.rb
trice-0.2.1 lib/trice/controller_methods/raw_reference_time.rb
trice-0.2.0 lib/trice/controller_methods/raw_reference_time.rb