Class: RuboCop::Cop::IndexMethod::Captures

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

Overview

Internal helper class to hold match data

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#transformed_argnameObject

Returns the value of attribute transformed_argname

Returns:

  • (Object)

    the current value of transformed_argname



10
11
12
# File 'lib/rubocop/cop/mixin/index_method.rb', line 10

def transformed_argname
  @transformed_argname
end

#transforming_body_exprObject

Returns the value of attribute transforming_body_expr

Returns:

  • (Object)

    the current value of transforming_body_expr



10
11
12
# File 'lib/rubocop/cop/mixin/index_method.rb', line 10

def transforming_body_expr
  @transforming_body_expr
end

Instance Method Details

#noop_transformation?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/rubocop/cop/mixin/index_method.rb', line 14

def noop_transformation?
  transforming_body_expr.lvar_type? && transforming_body_expr.children == [transformed_argname]
end