Class: GraphQL::Doctor::Suggestion

Inherits:
Struct
  • Object
show all
Defined in:
lib/graphql/doctor/diagnostic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ Suggestion

Returns a new instance of Suggestion.



8
9
10
11
# File 'lib/graphql/doctor/diagnostic.rb', line 8

def initialize(**attributes)
  super
  freeze
end

Instance Attribute Details

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



7
8
9
# File 'lib/graphql/doctor/diagnostic.rb', line 7

def location
  @location
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



7
8
9
# File 'lib/graphql/doctor/diagnostic.rb', line 7

def message
  @message
end

#replacementObject

Returns the value of attribute replacement

Returns:

  • (Object)

    the current value of replacement



7
8
9
# File 'lib/graphql/doctor/diagnostic.rb', line 7

def replacement
  @replacement
end

Instance Method Details

#to_hObject



13
14
15
# File 'lib/graphql/doctor/diagnostic.rb', line 13

def to_h
  {message: message, replacement: replacement, location: location&.to_h}.compact
end