Sha256: f2c12bc654bcd30a94a73b4f1f08e9275f7a0b55a2b2a119311015fd4ad9f807

Contents?: true

Size: 787 Bytes

Versions: 27

Compression:

Stored size: 787 Bytes

Contents

module Foobara
  class Error
    class << self
      def types_depended_on(*args)
        if args.size == 1
          context_type.types_depended_on(args.first)
        elsif args.empty?
          begin
            if context_type
              context_type.types_depended_on
            else
              raise Foobara::TypeDeclarations::ErrorExtension::NoContextTypeSetError
            end
          rescue Foobara::TypeDeclarations::ErrorExtension::NoContextTypeSetError
            if abstract?
              []
            else
              # :nocov:
              raise
              # :nocov:
            end
          end

        else
          # :nocov:
          raise ArgumentError, "Too many arguments #{args}"
          # :nocov:
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
foobara-0.0.7 projects/types/src/extensions/error.rb
foobara-0.0.6 projects/types/src/extensions/error.rb
foobara-0.0.5 projects/types/src/extensions/error.rb
foobara-0.0.4 projects/types/src/extensions/error.rb
foobara-0.0.3 projects/types/src/extensions/error.rb
foobara-0.0.2 projects/types/src/extensions/error.rb
foobara-0.0.1 projects/types/src/extensions/error.rb