Sha256: 00a550f9ac460620db78e5e68d3623bb1affe09fb07d0704ccbb333a6bb65b5b

Contents?: true

Size: 634 Bytes

Versions: 1

Compression:

Stored size: 634 Bytes

Contents

module Bugsnag
  module Helpers
    def self.cleanup_hash(hash)
      hash.inject({}) do |h, (k, v)|
        h[k.to_s.gsub(/\./, "-")] = v.to_s
        h
      end
    end
    
    def self.apply_filters(hash, filters)
      if filters
        hash.each do |k, v|
          if filters.any? {|f| k.to_s.include?(f.to_s) }
            hash[k] = "[FILTERED]"
          elsif v.respond_to?(:to_hash)
            apply_filters(hash[k])
          end
        end
      end
    end
    
    def self.param_context(params)
      "#{params[:controller]}##{params[:action]}" if params && params[:controller] && params[:action]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bugsnag-1.0.5 lib/bugsnag/helpers.rb