class SyntaxTree::CallOperatorFormatter
- Wraps a call operator (which can be a string literal
-
or an
Op
node or a
Period
node) and formats it when called.
Attributes
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 2702 def initialize(operator) @operator = operator end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 2706 def comments operator == :"::" ? [] : operator.comments end
Source
# File lib/syntax_tree/node.rb, line 2710 def format(q) case operator when :"::" q.text(".") when Op operator.value == "::" ? q.text(".") : operator.format(q) else operator.format(q) end end