Class: GraphQL::StaticValidation::Message
- Inherits:
-
Object
- Object
- GraphQL::StaticValidation::Message
- Defined in:
- lib/graphql/static_validation/message.rb
Overview
Generates GraphQL-compliant validation message. Only supports one “location”, too bad :(
Defined Under Namespace
Modules: MessageHelper
Instance Attribute Summary collapse
-
#col ⇒ Object
readonly
Returns the value of attribute col.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(message, line: nil, col: nil, path: []) ⇒ Message
constructor
A new instance of Message.
-
#to_h ⇒ Object
A hash representation of this Message.
Constructor Details
#initialize(message, line: nil, col: nil, path: []) ⇒ Message
Returns a new instance of Message.
17 18 19 20 21 22 |
# File 'lib/graphql/static_validation/message.rb', line 17 def initialize(, line: nil, col: nil, path: []) @message = @line = line @col = col @path = path end |
Instance Attribute Details
#col ⇒ Object (readonly)
Returns the value of attribute col.
15 16 17 |
# File 'lib/graphql/static_validation/message.rb', line 15 def col @col end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
15 16 17 |
# File 'lib/graphql/static_validation/message.rb', line 15 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
15 16 17 |
# File 'lib/graphql/static_validation/message.rb', line 15 def @message end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
15 16 17 |
# File 'lib/graphql/static_validation/message.rb', line 15 def path @path end |
Instance Method Details
#to_h ⇒ Object
A hash representation of this Message
25 26 27 28 29 30 31 |
# File 'lib/graphql/static_validation/message.rb', line 25 def to_h { "message" => , "locations" => locations, "path" => path, } end |