Class: Spoom::Model::SymbolDef
- Inherits:
-
Object
- Object
- Spoom::Model::SymbolDef
- Extended by:
- T::Helpers
- 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
-
#comments ⇒ Object
readonly
The comments associated with this definition : Array.
-
#location ⇒ Object
readonly
The actual code location of this definition : Location.
-
#owner ⇒ Object
readonly
The enclosing namespace this definition belongs to : Namespace?.
-
#symbol ⇒ Object
readonly
The symbol this definition belongs to : Symbol.
Instance Method Summary collapse
-
#full_name ⇒ Object
The full name of the symbol this definition belongs to : -> String.
-
#initialize(symbol, owner:, location:, comments:) ⇒ SymbolDef
constructor
: (Symbol symbol, owner: Namespace?, location: Location, ?comments: Array) -> void.
-
#name ⇒ Object
The short name of the symbol this definition belongs to : -> String.
Constructor Details
#initialize(symbol, owner:, location:, comments:) ⇒ SymbolDef
: (Symbol symbol, owner: Namespace?, location: Location, ?comments: Array) -> void
88 89 90 91 92 93 94 95 96 |
# File 'lib/spoom/model/model.rb', line 88 def initialize(symbol, owner:, location:, comments:) @symbol = symbol @owner = owner @location = location @comments = comments symbol.definitions << self owner.children << self if owner end |
Instance Attribute Details
#comments ⇒ Object (readonly)
The comments associated with this definition : Array
85 86 87 |
# File 'lib/spoom/model/model.rb', line 85 def comments @comments end |
#location ⇒ Object (readonly)
The actual code location of this definition : Location
81 82 83 |
# File 'lib/spoom/model/model.rb', line 81 def location @location end |
#owner ⇒ Object (readonly)
The enclosing namespace this definition belongs to : Namespace?
77 78 79 |
# File 'lib/spoom/model/model.rb', line 77 def owner @owner end |
#symbol ⇒ Object (readonly)
The symbol this definition belongs to : Symbol
73 74 75 |
# File 'lib/spoom/model/model.rb', line 73 def symbol @symbol end |
Instance Method Details
#full_name ⇒ Object
The full name of the symbol this definition belongs to : -> String
100 101 102 |
# File 'lib/spoom/model/model.rb', line 100 def full_name @symbol.full_name end |
#name ⇒ Object
The short name of the symbol this definition belongs to : -> String
106 107 108 |
# File 'lib/spoom/model/model.rb', line 106 def name @symbol.name end |