Sha256: 3dac0dd626cfd28c0b29c888ee7fc93c69dfbab2c4d06c099a708e67459babeb

Contents?: true

Size: 545 Bytes

Versions: 16

Compression:

Stored size: 545 Bytes

Contents

module Dry
  module Guards
    class NotGuardable < StandardError
      def initialize(method, cause)
        reason = case cause
                 when :nil then 'source location is inavailable'
                 when Errno::ENOENT then "source file could not be read [#{cause.message}]"
                 when :when_is_nil then 'when clause is missing'
                 when :when_not_hash then 'when clause is not a hash'
                 end
        super "Can’t guard method “#{method.inspect}” (#{reason}.)"
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dry-behaviour-0.12.1 lib/dry/errors/not_guardable.rb
dry-behaviour-0.12.0 lib/dry/errors/not_guardable.rb
dry-behaviour-0.11.2 lib/dry/errors/not_guardable.rb
dry-behaviour-0.11.1 lib/dry/errors/not_guardable.rb
dry-behaviour-0.11.0 lib/dry/errors/not_guardable.rb
dry-behaviour-0.10.4 lib/dry/errors/not_guardable.rb
dry-behaviour-0.10.3 lib/dry/errors/not_guardable.rb
dry-behaviour-0.10.2 lib/dry/errors/not_guardable.rb
dry-behaviour-0.10.1 lib/dry/errors/not_guardable.rb
dry-behaviour-0.9.0 lib/dry/errors/not_guardable.rb
dry-behaviour-0.8.0 lib/dry/errors/not_guardable.rb
dry-behaviour-0.7.0 lib/dry/errors/not_guardable.rb
dry-behaviour-0.6.0 lib/dry/errors/not_guardable.rb
dry-behaviour-0.5.2 lib/dry/errors/not_guardable.rb
dry-behaviour-0.5.1 lib/dry/errors/not_guardable.rb
dry-behaviour-0.5.0 lib/dry/errors/not_guardable.rb