Class: Psych::Handlers::DocumentStream
- Inherits:
-
TreeBuilder
- Object
- Psych::Handler
- TreeBuilder
- Psych::Handlers::DocumentStream
- Defined in:
- lib/psych/handlers/document_stream.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from TreeBuilder
Instance Method Summary collapse
- #end_document(implicit_end = !streaming?) ⇒ Object
-
#initialize(&block) ⇒ DocumentStream
constructor
A new instance of DocumentStream.
- #start_document(version, tag_directives, implicit) ⇒ Object
Methods inherited from TreeBuilder
#alias, #end_stream, #scalar, #start_stream
Methods inherited from Psych::Handler
#alias, #empty, #end_mapping, #end_sequence, #end_stream, #scalar, #start_mapping, #start_sequence, #start_stream, #streaming?
Constructor Details
#initialize(&block) ⇒ DocumentStream
Returns a new instance of DocumentStream.
6 7 8 9 |
# File 'lib/psych/handlers/document_stream.rb', line 6 def initialize &block super @block = block end |
Instance Method Details
#end_document(implicit_end = !streaming?) ⇒ Object
16 17 18 19 |
# File 'lib/psych/handlers/document_stream.rb', line 16 def end_document implicit_end = !streaming? @last.implicit_end = implicit_end @block.call pop end |