Class: Spoom::Model::Symbol
- Inherits:
-
Object
- Object
- Spoom::Model::Symbol
- Defined in:
- lib/spoom/model/model.rb
Overview
A Symbol is a uniquely named entity in the Ruby codebase
A symbol can have multiple definitions, e.g. a class can be reopened. Sometimes a symbol can have multiple definitions of different types, e.g. ‘foo` method can be defined both as a method and as an attribute accessor.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#definitions ⇒ Object
readonly
The definitions of this symbol (where it exists in the code) : Array.
-
#full_name ⇒ Object
readonly
The full, unique name of this symbol : String.
Instance Method Summary collapse
-
#initialize(full_name) ⇒ Symbol
constructor
: (String full_name) -> void.
-
#name ⇒ Object
The short name of this symbol : -> String.
-
#to_s ⇒ Object
: -> String.
Constructor Details
Instance Attribute Details
#definitions ⇒ Object (readonly)
The definitions of this symbol (where it exists in the code) : Array
34 35 36 |
# File 'lib/spoom/model/model.rb', line 34 def definitions @definitions end |
#full_name ⇒ Object (readonly)
The full, unique name of this symbol : String
30 31 32 |
# File 'lib/spoom/model/model.rb', line 30 def full_name @full_name end |
Instance Method Details
#name ⇒ Object
The short name of this symbol : -> String
44 45 46 |
# File 'lib/spoom/model/model.rb', line 44 def name T.must(@full_name.split("::").last) end |
#to_s ⇒ Object
: -> String
49 50 51 |
# File 'lib/spoom/model/model.rb', line 49 def to_s @full_name end |