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.
Instance Method Summary collapse
-
#initialize(message, line: nil, col: nil) ⇒ Message
constructor
A new instance of Message.
-
#to_h ⇒ Object
A hash representation of this Message.
Constructor Details
#initialize(message, line: nil, col: nil) ⇒ Message
Returns a new instance of Message.
15 16 17 18 19 |
# File 'lib/graphql/static_validation/message.rb', line 15 def initialize(, line: nil, col: nil) @message = @line = line @col = col end |
Instance Attribute Details
#col ⇒ Object (readonly)
Returns the value of attribute col.
13 14 15 |
# File 'lib/graphql/static_validation/message.rb', line 13 def col @col end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
13 14 15 |
# File 'lib/graphql/static_validation/message.rb', line 13 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
13 14 15 |
# File 'lib/graphql/static_validation/message.rb', line 13 def @message end |
Instance Method Details
#to_h ⇒ Object
A hash representation of this Message
22 23 24 25 26 27 |
# File 'lib/graphql/static_validation/message.rb', line 22 def to_h { "message" => , "locations" => locations } end |