Exception: Evil::Client::TypeError
- Inherits:
-
TypeError
- Object
- TypeError
- Evil::Client::TypeError
- 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
-
.check!(schema, name, type) ⇒ Symbol
Checks whether a name can be used to define operation/scope of the schema.
Class Method Details
.check!(schema, name, type) ⇒ Symbol
Checks whether a name can be used to define operation/scope of the schema
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 |