Class: Decode::Definition
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
Attributes inherited from Symbol
#kind, #language, #name, #parent
Instance Method Summary collapse
- #documentation ⇒ Object
-
#initialize(kind, name, node, comments, **options) ⇒ Definition
constructor
A new instance of Definition.
- #text ⇒ Object
Methods inherited from Symbol
#inspect, #key, #lexical_path, #path, #qualified_name
Constructor Details
#initialize(kind, name, node, comments, **options) ⇒ Definition
Returns a new instance of Definition.
70 71 72 73 74 75 76 |
# File 'lib/decode/symbol.rb', line 70 def initialize(kind, name, node, comments, **) super(kind, name, **) @node = node @comments = comments @documentation = nil end |
Instance Attribute Details
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
82 83 84 |
# File 'lib/decode/symbol.rb', line 82 def comments @comments end |
Instance Method Details
#documentation ⇒ Object
84 85 86 87 88 |
# File 'lib/decode/symbol.rb', line 84 def documentation if @comments.any? @documentation ||= Documentation.new(@comments) end end |
#text ⇒ Object
78 79 80 |
# File 'lib/decode/symbol.rb', line 78 def text @node.location.expression.source end |