Sha256: be3dab37af08c9dc158344f37482969eda0847a359d187da84b42a7729827303

Contents?: true

Size: 480 Bytes

Versions: 1

Compression:

Stored size: 480 Bytes

Contents

module MiniSanity
  class Error < RuntimeError

    def initialize(message, details = {})
      super([
        message,
        *details.compact.map{|name, value| "#{name}:\n  #{value}" }
      ].join("\n\n"))
    end

    # @!visibility private
    def self.describe_block(&block)
      if (symbol_name = block.to_s[/\(&:(.+)\)>$/, 1])
        "&:#{symbol_name}"
      elsif block&.source_location
        "block@#{block.source_location.join(":")}"
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mini_sanity-2.0.0 lib/mini_sanity/error.rb