Sha256: 5e78f8726aecddbcc35ea36653e903720b41ade3a300bbefebaf6be9cf29255c

Contents?: true

Size: 689 Bytes

Versions: 14

Compression:

Stored size: 689 Bytes

Contents

# frozen_string_literal: true

class LHC::Interceptor

  attr_reader :request

  def initialize(request)
    @request = request
  end

  def response
    @request.response
  end

  def before_raw_request; end

  def before_request; end

  def after_request; end

  def before_response; end

  def after_response; end

  # Prevent Interceptors from beeing duplicated!
  # Their classes have flag-character.
  # When duplicated you can't check for their class name anymore:
  # e.g. options.deep_dup[:interceptors].include?(LHC::Caching) # false
  def self.dup
    self
  end

  def all_interceptor_classes
    @all_interceptors ||= LHC::Interceptors.new(request).all.map(&:class)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
lhc-15.2.1 lib/lhc/interceptor.rb
lhc-15.2.0 lib/lhc/interceptor.rb
lhc-15.1.3 lib/lhc/interceptor.rb
lhc-15.1.2 lib/lhc/interceptor.rb
lhc-15.1.1 lib/lhc/interceptor.rb
lhc-15.1.0 lib/lhc/interceptor.rb
lhc-16.0.0.pre.pro2162.2 lib/lhc/interceptor.rb
lhc-16.0.0.pre.pro2162 lib/lhc/interceptor.rb
lhc-15.0.1 lib/lhc/interceptor.rb
lhc-15.0.0 lib/lhc/interceptor.rb
lhc-14.0.0 lib/lhc/interceptor.rb
lhc-13.4.0.pre.pro1766.1 lib/lhc/interceptor.rb
lhc-13.2.0 lib/lhc/interceptor.rb
lhc-13.1.0 lib/lhc/interceptor.rb