Class: PrettyPrint::Buffer::DefaultBuffer
- Inherits:
-
Object
- Object
- PrettyPrint::Buffer::DefaultBuffer
- Defined in:
- lib/syntax_tree/prettyprint.rb
Overview
This is the default output buffer that provides a base implementation of trim! that does nothing. It’s effectively a wrapper around whatever output object was given to the format command.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #<<(object) ⇒ Object
-
#initialize(output = []) ⇒ DefaultBuffer
constructor
A new instance of DefaultBuffer.
- #trim! ⇒ Object
Constructor Details
#initialize(output = []) ⇒ DefaultBuffer
Returns a new instance of DefaultBuffer.
277 278 279 |
# File 'lib/syntax_tree/prettyprint.rb', line 277 def initialize(output = []) @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
275 276 277 |
# File 'lib/syntax_tree/prettyprint.rb', line 275 def output @output end |
Instance Method Details
#<<(object) ⇒ Object
281 282 283 |
# File 'lib/syntax_tree/prettyprint.rb', line 281 def <<(object) @output << object end |
#trim! ⇒ Object
285 286 287 |
# File 'lib/syntax_tree/prettyprint.rb', line 285 def trim! 0 end |