Class: RactorRailsShim::Check::Finding

Inherits:
Data
  • Object
show all
Defined in:
lib/ractor_rails_shim/roles/check.rb

Overview

kind: :ivar (class-level instance variable, @foo) or :cvar (class variable, @@foo — mattr_accessor/cattr_accessor) A Finding owns its own presentation tag (derived from kind) so the report is a thin formatter and the tag is testable in isolation without depending on the report's first-N truncation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ivarObject (readonly)

Returns the value of attribute ivar

Returns:

  • (Object)

    the current value of ivar



18
19
20
# File 'lib/ractor_rails_shim/roles/check.rb', line 18

def ivar
  @ivar
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



18
19
20
# File 'lib/ractor_rails_shim/roles/check.rb', line 18

def kind
  @kind
end

#ownerObject (readonly)

Returns the value of attribute owner

Returns:

  • (Object)

    the current value of owner



18
19
20
# File 'lib/ractor_rails_shim/roles/check.rb', line 18

def owner
  @owner
end

#shareableObject (readonly)

Returns the value of attribute shareable

Returns:

  • (Object)

    the current value of shareable



18
19
20
# File 'lib/ractor_rails_shim/roles/check.rb', line 18

def shareable
  @shareable
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



18
19
20
# File 'lib/ractor_rails_shim/roles/check.rb', line 18

def source
  @source
end

#value_classObject (readonly)

Returns the value of attribute value_class

Returns:

  • (Object)

    the current value of value_class



18
19
20
# File 'lib/ractor_rails_shim/roles/check.rb', line 18

def value_class
  @value_class
end

Instance Method Details

#tagObject

The presentation tag appended to this finding's report line. Class variables back mattr_accessor/cattr_accessor and are rerouted by the shim — tag them so the user knows they're auto-fixable. Class-level instance variables are NOT auto-fixed.



23
24
25
# File 'lib/ractor_rails_shim/roles/check.rb', line 23

def tag
  kind == :cvar ? " (mattr/cattr — shim targets)" : ""
end