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.
1878 1879 1880 1881 |
# File 'lib/syntax_tree/node.rb', line 1878 def initialize(text, node) @text = text @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
- LBrace | Keyword
-
the node that is being represented
1876 1877 1878 |
# File 'lib/syntax_tree/node.rb', line 1876 def node @node end |
#text ⇒ Object (readonly)
- String
-
the actual output that should be printed
1873 1874 1875 |
# File 'lib/syntax_tree/node.rb', line 1873 def text @text end |
Instance Method Details
#comments ⇒ Object
1883 1884 1885 |
# File 'lib/syntax_tree/node.rb', line 1883 def comments node.comments end |
#format(q) ⇒ Object
1887 1888 1889 |
# File 'lib/syntax_tree/node.rb', line 1887 def format(q) q.text(text) end |