Class: GraphQL::Modernize::Offense

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/modernize/offense.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule_id:, location:, message:, safety:, path:, correctable:) ⇒ Offense

Returns a new instance of Offense.



9
10
11
12
13
14
15
16
17
# File 'lib/graphql/modernize/offense.rb', line 9

def initialize(rule_id:, location:, message:, safety:, path:, correctable:)
  @rule_id = rule_id
  @location = location
  @message = message
  @safety = safety
  @path = path
  @correctable = correctable
  @corrected = false
end

Instance Attribute Details

#conflicting_rule_idObject

Returns the value of attribute conflicting_rule_id.



7
8
9
# File 'lib/graphql/modernize/offense.rb', line 7

def conflicting_rule_id
  @conflicting_rule_id
end

#correctedObject

Returns the value of attribute corrected.



7
8
9
# File 'lib/graphql/modernize/offense.rb', line 7

def corrected
  @corrected
end

#locationObject (readonly)

Returns the value of attribute location.



6
7
8
# File 'lib/graphql/modernize/offense.rb', line 6

def location
  @location
end

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'lib/graphql/modernize/offense.rb', line 6

def message
  @message
end

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/graphql/modernize/offense.rb', line 6

def path
  @path
end

#rule_idObject (readonly)

Returns the value of attribute rule_id.



6
7
8
# File 'lib/graphql/modernize/offense.rb', line 6

def rule_id
  @rule_id
end

#safetyObject (readonly)

Returns the value of attribute safety.



6
7
8
# File 'lib/graphql/modernize/offense.rb', line 6

def safety
  @safety
end

Instance Method Details

#correctable?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/graphql/modernize/offense.rb', line 19

def correctable?
  @correctable
end

#corrected?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/graphql/modernize/offense.rb', line 23

def corrected?
  corrected
end