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
: -> void.
-
#alive? ⇒ Boolean
: -> bool.
-
#attr_reader? ⇒ Boolean
: -> bool.
-
#attr_writer? ⇒ Boolean
: -> bool.
-
#class? ⇒ Boolean
: -> bool.
-
#constant? ⇒ Boolean
: -> bool.
-
#dead? ⇒ Boolean
: -> bool.
-
#ignored! ⇒ Object
: -> void.
-
#ignored? ⇒ Boolean
: -> bool.
-
#method? ⇒ Boolean
: -> bool.
-
#module? ⇒ Boolean
: -> bool.
-
#to_json(*args) ⇒ Object
: (*untyped args) -> String.
Instance Method Details
#alive! ⇒ Object
: -> void
76 77 78 |
# File 'lib/spoom/deadcode/definition.rb', line 76 def alive! @status = Status::ALIVE end |
#alive? ⇒ Boolean
: -> bool
71 72 73 |
# File 'lib/spoom/deadcode/definition.rb', line 71 def alive? status == Status::ALIVE end |
#attr_reader? ⇒ Boolean
: -> bool
39 40 41 |
# File 'lib/spoom/deadcode/definition.rb', line 39 def attr_reader? kind == Kind::AttrReader end |
#attr_writer? ⇒ Boolean
: -> bool
44 45 46 |
# File 'lib/spoom/deadcode/definition.rb', line 44 def attr_writer? kind == Kind::AttrWriter end |
#class? ⇒ Boolean
: -> bool
49 50 51 |
# File 'lib/spoom/deadcode/definition.rb', line 49 def class? kind == Kind::Class end |
#constant? ⇒ Boolean
: -> bool
54 55 56 |
# File 'lib/spoom/deadcode/definition.rb', line 54 def constant? kind == Kind::Constant end |
#dead? ⇒ Boolean
: -> bool
81 82 83 |
# File 'lib/spoom/deadcode/definition.rb', line 81 def dead? status == Status::DEAD end |
#ignored! ⇒ Object
: -> void
91 92 93 |
# File 'lib/spoom/deadcode/definition.rb', line 91 def ignored! @status = Status::IGNORED end |
#ignored? ⇒ Boolean
: -> bool
86 87 88 |
# File 'lib/spoom/deadcode/definition.rb', line 86 def ignored? status == Status::IGNORED end |
#method? ⇒ Boolean
: -> bool
59 60 61 |
# File 'lib/spoom/deadcode/definition.rb', line 59 def method? kind == Kind::Method end |
#module? ⇒ Boolean
: -> bool
64 65 66 |
# File 'lib/spoom/deadcode/definition.rb', line 64 def module? kind == Kind::Module end |
#to_json(*args) ⇒ Object
: (*untyped args) -> String
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 |