Module: Psych::Pure::CommentExtensions::DocumentStream

Defined in:
lib/psych/pure.rb

Overview

Extend the document stream to be able to attach comments to the document.

Instance Method Summary collapse

Instance Method Details

#end_document(implicit_end = !streaming?)) ⇒ Object



789
790
791
792
793
794
795
# File 'lib/psych/pure.rb', line 789

def end_document(implicit_end = !streaming?)
  @last.implicit_end = implicit_end
  node = pop
  set_end_location(node)
  attach_comments(node)
  @block.call(node)
end

#start_document(version, tag_directives, implicit) ⇒ Object



783
784
785
786
787
# File 'lib/psych/pure.rb', line 783

def start_document(version, tag_directives, implicit)
  node = Nodes::Document.new(version, tag_directives, implicit)
  set_start_location(node)
  push(node)
end