Class: GraphQL::StaticValidation::Message
- Inherits:
-
Object
- Object
- GraphQL::StaticValidation::Message
- Defined in:
- lib/graphql/static_validation/message.rb
Overview
Generates GraphQL-compliant validation message.
Defined Under Namespace
Modules: MessageHelper
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(message, path: [], nodes: []) ⇒ Message
constructor
A new instance of Message.
-
#to_h ⇒ Object
A hash representation of this Message.
Constructor Details
#initialize(message, path: [], nodes: []) ⇒ Message
Returns a new instance of Message
18 19 20 21 22 |
# File 'lib/graphql/static_validation/message.rb', line 18 def initialize(, path: [], nodes: []) @message = @nodes = nodes @path = path end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message
16 17 18 |
# File 'lib/graphql/static_validation/message.rb', line 16 def @message end |
#path ⇒ Object (readonly)
Returns the value of attribute path
16 17 18 |
# File 'lib/graphql/static_validation/message.rb', line 16 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, "fields" => path, } end |