Class: PrettierPrint::Indent
- Inherits:
-
Object
- Object
- PrettierPrint::Indent
- Defined in:
- lib/prettier_print.rb
Overview
A node in the print tree that is a variant of the Align node that indents its contents by one level.
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
Instance Method Summary collapse
-
#initialize(contents: []) ⇒ Indent
constructor
A new instance of Indent.
- #pretty_print(q) ⇒ Object
Constructor Details
#initialize(contents: []) ⇒ Indent
Returns a new instance of Indent.
203 204 205 |
# File 'lib/prettier_print.rb', line 203 def initialize(contents: []) @contents = contents end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
201 202 203 |
# File 'lib/prettier_print.rb', line 201 def contents @contents end |
Instance Method Details
#pretty_print(q) ⇒ Object
207 208 209 210 211 |
# File 'lib/prettier_print.rb', line 207 def pretty_print(q) q.group(2, "indent([", "])") do q.seplist(contents) { |content| q.pp(content) } end end |