Class: Spoom::Deadcode::Definition

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/spoom/deadcode/definition.rb

Overview

A definition is a class, module, method, constant, etc. being defined in the code

Defined Under Namespace

Classes: Kind, Status

Instance Method Summary collapse

Instance Method Details

#alive!Object



78
79
80
# File 'lib/spoom/deadcode/definition.rb', line 78

def alive!
  @status = Status::ALIVE
end

#alive?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/spoom/deadcode/definition.rb', line 73

def alive?
  status == Status::ALIVE
end

#attr_reader?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/spoom/deadcode/definition.rb', line 41

def attr_reader?
  kind == Kind::AttrReader
end

#attr_writer?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/spoom/deadcode/definition.rb', line 46

def attr_writer?
  kind == Kind::AttrWriter
end

#class?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/spoom/deadcode/definition.rb', line 51

def class?
  kind == Kind::Class
end

#constant?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/spoom/deadcode/definition.rb', line 56

def constant?
  kind == Kind::Constant
end

#dead?Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/spoom/deadcode/definition.rb', line 83

def dead?
  status == Status::DEAD
end

#ignored!Object



93
94
95
# File 'lib/spoom/deadcode/definition.rb', line 93

def ignored!
  @status = Status::IGNORED
end

#ignored?Boolean

Returns:

  • (Boolean)


88
89
90
# File 'lib/spoom/deadcode/definition.rb', line 88

def ignored?
  status == Status::IGNORED
end

#method?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/spoom/deadcode/definition.rb', line 61

def method?
  kind == Kind::Method
end

#module?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/spoom/deadcode/definition.rb', line 66

def module?
  kind == Kind::Module
end