Class: Rbr::CommentNode
- Inherits:
-
Object
- Object
- Rbr::CommentNode
- Defined in:
- lib/rbr/comment_node.rb
Overview
Wraps a Parser::Source::Comment object and provides convenience methods
Instance Method Summary collapse
- #expression ⇒ Object
-
#initialize(parser_comment) ⇒ CommentNode
constructor
A new instance of CommentNode.
- #pretty_print ⇒ Object
Constructor Details
#initialize(parser_comment) ⇒ CommentNode
Returns a new instance of CommentNode.
6 7 8 |
# File 'lib/rbr/comment_node.rb', line 6 def initialize(parser_comment) @parser_comment = parser_comment end |
Instance Method Details
#expression ⇒ Object
10 11 12 |
# File 'lib/rbr/comment_node.rb', line 10 def expression @parser_comment.loc.expression end |
#pretty_print ⇒ Object
14 15 16 |
# File 'lib/rbr/comment_node.rb', line 14 def pretty_print "#{expression.line}: #{@parser_comment.text}" end |