Exception: GQL::Errors::NoMethodError
- Inherits:
-
GQL::Error
- Object
- StandardError
- GQL::Error
- GQL::Errors::NoMethodError
- Defined in:
- lib/gql/errors.rb
Instance Attribute Summary collapse
-
#cause ⇒ Object
readonly
Returns the value of attribute cause.
Attributes inherited from GQL::Error
Instance Method Summary collapse
-
#initialize(node_class, id, cause) ⇒ NoMethodError
constructor
A new instance of NoMethodError.
Methods inherited from GQL::Error
Constructor Details
#initialize(node_class, id, cause) ⇒ NoMethodError
Returns a new instance of NoMethodError.
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/gql/errors.rb', line 75 def initialize(node_class, id, cause) @cause = cause msg = "Undefined method `#{id}' for #{node_class}. " msg << "Did you try to add a field of type `#{id}'? " msg << "If so, you have to register your field type first " msg << "like this: `GQL.field_types[:#{id}] = My#{id.to_s.camelize}'. " msg << "The following field types are currently registered: " msg << GQL.field_types.keys.sort.map { |key| "`#{key}'" }.to_sentence super(msg, 122) end |
Instance Attribute Details
#cause ⇒ Object (readonly)
Returns the value of attribute cause.
73 74 75 |
# File 'lib/gql/errors.rb', line 73 def cause @cause end |