Class: Spoom::Model::SymbolDef
- Inherits:
-
Object
- Object
- Spoom::Model::SymbolDef
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/spoom/model/model.rb
Overview
A SymbolDef is a definition of a Symbol
It can be a class, module, constant, method, etc. A SymbolDef has a location pointing to the actual code that defines the symbol.
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
- #full_name ⇒ Object
-
#initialize(symbol, owner:, location:) ⇒ SymbolDef
constructor
A new instance of SymbolDef.
- #name ⇒ Object
Constructor Details
#initialize(symbol, owner:, location:) ⇒ SymbolDef
Returns a new instance of SymbolDef.
74 75 76 77 78 79 80 81 |
# File 'lib/spoom/model/model.rb', line 74 def initialize(symbol, owner:, location:) @symbol = symbol @owner = owner @location = location symbol.definitions << self owner.children << self if owner end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
71 72 73 |
# File 'lib/spoom/model/model.rb', line 71 def location @location end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
67 68 69 |
# File 'lib/spoom/model/model.rb', line 67 def owner @owner end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
63 64 65 |
# File 'lib/spoom/model/model.rb', line 63 def symbol @symbol end |
Instance Method Details
#full_name ⇒ Object
85 86 87 |
# File 'lib/spoom/model/model.rb', line 85 def full_name @symbol.full_name end |
#name ⇒ Object
91 92 93 |
# File 'lib/spoom/model/model.rb', line 91 def name @symbol.name end |