Class: Spoom::Deadcode::Definition
- Inherits:
-
T::Struct
- Object
- T::Struct
- Spoom::Deadcode::Definition
- 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
Instance Method Summary collapse
- #alive! ⇒ Object
- #alive? ⇒ Boolean
- #attr_reader? ⇒ Boolean
- #attr_writer? ⇒ Boolean
- #class? ⇒ Boolean
- #constant? ⇒ Boolean
- #dead? ⇒ Boolean
- #ignored! ⇒ Object
- #ignored? ⇒ Boolean
- #method? ⇒ Boolean
- #module? ⇒ Boolean
- #to_json(*args) ⇒ Object
Instance Method Details
#alive! ⇒ Object
76 77 78 |
# File 'lib/spoom/deadcode/definition.rb', line 76 def alive! @status = Status::ALIVE end |
#alive? ⇒ Boolean
71 72 73 |
# File 'lib/spoom/deadcode/definition.rb', line 71 def alive? status == Status::ALIVE end |
#attr_reader? ⇒ Boolean
39 40 41 |
# File 'lib/spoom/deadcode/definition.rb', line 39 def attr_reader? kind == Kind::AttrReader end |
#attr_writer? ⇒ Boolean
44 45 46 |
# File 'lib/spoom/deadcode/definition.rb', line 44 def attr_writer? kind == Kind::AttrWriter end |
#class? ⇒ Boolean
49 50 51 |
# File 'lib/spoom/deadcode/definition.rb', line 49 def class? kind == Kind::Class end |
#constant? ⇒ Boolean
54 55 56 |
# File 'lib/spoom/deadcode/definition.rb', line 54 def constant? kind == Kind::Constant end |
#dead? ⇒ Boolean
81 82 83 |
# File 'lib/spoom/deadcode/definition.rb', line 81 def dead? status == Status::DEAD end |
#ignored! ⇒ Object
91 92 93 |
# File 'lib/spoom/deadcode/definition.rb', line 91 def ignored! @status = Status::IGNORED end |
#ignored? ⇒ Boolean
86 87 88 |
# File 'lib/spoom/deadcode/definition.rb', line 86 def ignored? status == Status::IGNORED end |
#method? ⇒ Boolean
59 60 61 |
# File 'lib/spoom/deadcode/definition.rb', line 59 def method? kind == Kind::Method end |
#module? ⇒ Boolean
64 65 66 |
# File 'lib/spoom/deadcode/definition.rb', line 64 def module? kind == Kind::Module end |
#to_json(*args) ⇒ Object
98 99 100 101 102 103 104 |
# File 'lib/spoom/deadcode/definition.rb', line 98 def to_json(*args) { kind: kind, name: name, location: location.to_s, }.to_json end |