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.
2275 2276 2277 2278 |
# File 'lib/syntax_tree/node.rb', line 2275 def initialize(text, node) @text = text @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
- LBrace | Keyword
-
the node that is being represented
2273 2274 2275 |
# File 'lib/syntax_tree/node.rb', line 2273 def node @node end |
#text ⇒ Object (readonly)
- String
-
the actual output that should be printed
2270 2271 2272 |
# File 'lib/syntax_tree/node.rb', line 2270 def text @text end |
Instance Method Details
#comments ⇒ Object
2280 2281 2282 |
# File 'lib/syntax_tree/node.rb', line 2280 def comments node.comments end |
#format(q) ⇒ Object
2284 2285 2286 |
# File 'lib/syntax_tree/node.rb', line 2284 def format(q) q.text(text) end |