Class: Spoom::Model::SymbolDef Abstract
- Inherits:
-
Object
- Object
- Spoom::Model::SymbolDef
- 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
85 86 87 88 89 90 91 92 93 |
# File 'lib/spoom/model/model.rb', line 85 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
82 83 84 |
# File 'lib/spoom/model/model.rb', line 82 def comments @comments end |
#location ⇒ Object (readonly)
The actual code location of this definition : Location
78 79 80 |
# File 'lib/spoom/model/model.rb', line 78 def location @location end |
#owner ⇒ Object (readonly)
The enclosing namespace this definition belongs to : Namespace?
74 75 76 |
# File 'lib/spoom/model/model.rb', line 74 def owner @owner end |
#symbol ⇒ Object (readonly)
The symbol this definition belongs to : Symbol
70 71 72 |
# File 'lib/spoom/model/model.rb', line 70 def symbol @symbol end |
Instance Method Details
#full_name ⇒ Object
The full name of the symbol this definition belongs to : -> String
97 98 99 |
# File 'lib/spoom/model/model.rb', line 97 def full_name @symbol.full_name end |
#name ⇒ Object
The short name of the symbol this definition belongs to : -> String
103 104 105 |
# File 'lib/spoom/model/model.rb', line 103 def name @symbol.name end |