Class: SyntaxTree::Index::FileComments::Parser
- Inherits:
-
Ripper
- Object
- Ripper
- SyntaxTree::Index::FileComments::Parser
- Defined in:
- lib/syntax_tree/index.rb
Overview
We use the ripper library to pull out source comments.
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
Instance Method Summary collapse
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #on_comment(value) ⇒ Object
Constructor Details
#initialize ⇒ Parser
77 78 79 80 |
# File 'lib/syntax_tree/index.rb', line 77 def initialize(*) super @comments = {} end |
Instance Attribute Details
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
75 76 77 |
# File 'lib/syntax_tree/index.rb', line 75 def comments @comments end |
Instance Method Details
#on_comment(value) ⇒ Object
82 83 84 |
# File 'lib/syntax_tree/index.rb', line 82 def on_comment(value) comments[lineno] = value.chomp end |