Class: SyntaxTree::BlockFormatter::BlockOpenFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::BlockFormatter::BlockOpenFormatter
- Defined in:
- lib/syntax_tree.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
- LBrace | Keyword
-
the node that is being represented.
-
#text ⇒ Object
readonly
- String
-
the actual output that should be printed.
Instance Method Summary collapse
- #comments ⇒ Object
- #format(q) ⇒ Object
-
#initialize(text, node) ⇒ BlockOpenFormatter
constructor
A new instance of BlockOpenFormatter.
Constructor Details
#initialize(text, node) ⇒ BlockOpenFormatter
Returns a new instance of BlockOpenFormatter.
2781 2782 2783 2784 |
# File 'lib/syntax_tree.rb', line 2781 def initialize(text, node) @text = text @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
- LBrace | Keyword
-
the node that is being represented
2779 2780 2781 |
# File 'lib/syntax_tree.rb', line 2779 def node @node end |
#text ⇒ Object (readonly)
- String
-
the actual output that should be printed
2776 2777 2778 |
# File 'lib/syntax_tree.rb', line 2776 def text @text end |
Instance Method Details
#comments ⇒ Object
2786 2787 2788 |
# File 'lib/syntax_tree.rb', line 2786 def comments node.comments end |
#format(q) ⇒ Object
2790 2791 2792 |
# File 'lib/syntax_tree.rb', line 2790 def format(q) q.text(text) end |