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.
2919 2920 2921 2922 |
# File 'lib/syntax_tree.rb', line 2919 def initialize(text, node) @text = text @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
- LBrace | Keyword
-
the node that is being represented
2917 2918 2919 |
# File 'lib/syntax_tree.rb', line 2917 def node @node end |
#text ⇒ Object (readonly)
- String
-
the actual output that should be printed
2914 2915 2916 |
# File 'lib/syntax_tree.rb', line 2914 def text @text end |
Instance Method Details
#comments ⇒ Object
2924 2925 2926 |
# File 'lib/syntax_tree.rb', line 2924 def comments node.comments end |
#format(q) ⇒ Object
2928 2929 2930 |
# File 'lib/syntax_tree.rb', line 2928 def format(q) q.text(text) end |