Class: SyntaxTree::BlockFormatter::BlockOpenFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::BlockFormatter::BlockOpenFormatter
- Defined in:
- lib/syntax_tree/node.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.
2350 2351 2352 2353 |
# File 'lib/syntax_tree/node.rb', line 2350 def initialize(text, node) @text = text @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
- LBrace | Keyword
-
the node that is being represented
2348 2349 2350 |
# File 'lib/syntax_tree/node.rb', line 2348 def node @node end |
#text ⇒ Object (readonly)
- String
-
the actual output that should be printed
2345 2346 2347 |
# File 'lib/syntax_tree/node.rb', line 2345 def text @text end |
Instance Method Details
#comments ⇒ Object
2355 2356 2357 |
# File 'lib/syntax_tree/node.rb', line 2355 def comments node.comments end |
#format(q) ⇒ Object
2359 2360 2361 |
# File 'lib/syntax_tree/node.rb', line 2359 def format(q) q.text(text) end |