Exception: Evil::Client::TypeError

Inherits:
TypeError
  • Object
show all
Defined in:
lib/evil/client/exceptions/type_error.rb

Overview

Exception to be risen when user defines a scope/operation with a name, that has been used by existing operation/scope.

Class Method Summary collapse

Class Method Details

.check!(schema, name, type) ⇒ Symbol

Checks whether a name can be used to define operation/scope of the schema

Parameters:

Returns:

  • (Symbol)

    nil

Raises:

  • (self)

    if name cannot be used



15
16
17
18
19
# File 'lib/evil/client/exceptions/type_error.rb', line 15

def self.check!(schema, name, type)
  return if type == :scope && schema.operations[name].nil?
  return if type == :operation && schema.scopes[name].nil?
  raise new(name, type)
end