Class: Psych::Handlers::DocumentStream
- Inherits:
-
TreeBuilder
- Object
- Psych::Handler
- TreeBuilder
- Psych::Handlers::DocumentStream
- Defined in:
- lib/psych/handlers/document_stream.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Psych::Handler
Psych::Handler::EVENTS, Psych::Handler::OPTIONS
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.
7 8 9 10 |
# File 'lib/psych/handlers/document_stream.rb', line 7 def initialize &block super @block = block end |
Instance Method Details
#end_document(implicit_end = !streaming?) ⇒ Object
17 18 19 20 |
# File 'lib/psych/handlers/document_stream.rb', line 17 def end_document implicit_end = !streaming? @last.implicit_end = implicit_end @block.call pop end |