Sha256: acc08e936941a44ab8b2e948984b0c47054fc5246f3c453bca057665fe3f52da

Contents?: true

Size: 525 Bytes

Versions: 62

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

require 'active_support'

class LHS::Record

  module Tracing
    extend ActiveSupport::Concern

    module ClassMethods
      # Needs to be called directly from the first method (level) within LHS
      def trace!(options = {})
        return options unless LHS.config.trace

        (options || {}).tap do |options|
          source = caller.detect do |source|
            !source.match?(%r{/lib/lhs})
          end
          options[:source] = source
        end
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
lhs-21.0.0 lib/lhs/concerns/record/tracing.rb
lhs-20.1.4 lib/lhs/concerns/record/tracing.rb
lhs-20.1.3.pre.paginationfix.3 lib/lhs/concerns/record/tracing.rb
lhs-20.1.3.pre.paginationfix.2 lib/lhs/concerns/record/tracing.rb
lhs-20.1.3.pre.paginationfix.1 lib/lhs/concerns/record/tracing.rb
lhs-20.1.2 lib/lhs/concerns/record/tracing.rb
lhs-20.1.1 lib/lhs/concerns/record/tracing.rb
lhs-20.0.0 lib/lhs/concerns/record/tracing.rb
lhs-19.10.0 lib/lhs/concerns/record/tracing.rb
lhs-19.9.0 lib/lhs/concerns/record/tracing.rb
lhs-19.8.2 lib/lhs/concerns/record/tracing.rb
lhs-19.8.1 lib/lhs/concerns/record/tracing.rb
lhs-19.8.0 lib/lhs/concerns/record/tracing.rb
lhs-19.7.0 lib/lhs/concerns/record/tracing.rb
lhs-19.6.0 lib/lhs/concerns/record/tracing.rb
lhs-19.5.0 lib/lhs/concerns/record/tracing.rb
lhs-19.5.0.pre.wherehref.1 lib/lhs/concerns/record/tracing.rb
lhs-19.4.1 lib/lhs/concerns/record/tracing.rb
lhs-19.4.0 lib/lhs/concerns/record/tracing.rb
lhs-19.3.1 lib/lhs/concerns/record/tracing.rb