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.
1830 1831 1832 1833 |
# File 'lib/syntax_tree/node.rb', line 1830 def initialize(text, node) @text = text @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
- LBrace | Keyword
-
the node that is being represented
1828 1829 1830 |
# File 'lib/syntax_tree/node.rb', line 1828 def node @node end |
#text ⇒ Object (readonly)
- String
-
the actual output that should be printed
1825 1826 1827 |
# File 'lib/syntax_tree/node.rb', line 1825 def text @text end |
Instance Method Details
#comments ⇒ Object
1835 1836 1837 |
# File 'lib/syntax_tree/node.rb', line 1835 def comments node.comments end |
#format(q) ⇒ Object
1839 1840 1841 |
# File 'lib/syntax_tree/node.rb', line 1839 def format(q) q.text(text) end |