Sha256: efd41d3e4046d329aa7719904d4746bf6d1badbdc8525fe92c10f30ae19b41e2

Contents?: true

Size: 530 Bytes

Versions: 1

Compression:

Stored size: 530 Bytes

Contents

module Flows
  class Contract
    # Class for {Type} errors.
    class Error < ::Flows::Error
      attr_reader :value, :value_error

      # @param value [Object] checked value
      # @param value_error [String] error message
      def initialize(value, value_error)
        @value = value
        @value_error = value_error
      end

      def message
        [
          'type check failed for:',
          "    `#{@value.inspect}`",
          "---\n",
          @value_error
        ].join("\n")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flows-0.6.0 lib/flows/contract/error.rb