Class: RuboCop::Cop::Cop::Correction

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubocop/cop/cop.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#copObject

Returns the value of attribute cop

Returns:

  • (Object)

    the current value of cop


34
35
36
# File 'lib/rubocop/cop/cop.rb', line 34

def cop
  @cop
end

#lambdaObject

Returns the value of attribute lambda

Returns:

  • (Object)

    the current value of lambda


34
35
36
# File 'lib/rubocop/cop/cop.rb', line 34

def lambda
  @lambda
end

#nodeObject

Returns the value of attribute node

Returns:

  • (Object)

    the current value of node


34
35
36
# File 'lib/rubocop/cop/cop.rb', line 34

def node
  @node
end

Instance Method Details

#call(corrector) ⇒ Object


35
36
37
38
39
40
41
# File 'lib/rubocop/cop/cop.rb', line 35

def call(corrector)
  lambda.call(corrector)
rescue StandardError => e
  raise ErrorWithAnalyzedFileLocation.new(
    cause: e, node: node, cop: cop
  )
end