Class: GraphQL::StaticValidation::Message
- Inherits:
-
Object
- Object
- GraphQL::StaticValidation::Message
- Defined in:
- lib/graph_ql/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
-
#co ⇒ Object
readonly
Returns the value of attribute co.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(message, line: nil, col: nil) ⇒ Message
constructor
A new instance of Message.
- #to_h ⇒ Object
Constructor Details
#initialize(message, line: nil, col: nil) ⇒ Message
Returns a new instance of Message.
12 13 14 15 16 |
# File 'lib/graph_ql/static_validation/message.rb', line 12 def initialize(, line: nil, col: nil) @message = @line = line @col = col end |
Instance Attribute Details
#co ⇒ Object (readonly)
Returns the value of attribute co.
11 12 13 |
# File 'lib/graph_ql/static_validation/message.rb', line 11 def co @co end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
11 12 13 |
# File 'lib/graph_ql/static_validation/message.rb', line 11 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
11 12 13 |
# File 'lib/graph_ql/static_validation/message.rb', line 11 def @message end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 |
# File 'lib/graph_ql/static_validation/message.rb', line 17 def to_h { "message" => , "locations" => locations } end |