Sha256: de454355cb10671dbeba9ef01ee1b18c174f9373649c94f9d5ac8509729963d3

Contents?: true

Size: 1.75 KB

Versions: 115

Compression:

Stored size: 1.75 KB

Contents

module Psych
  module Nodes
    ###
    # This represents a YAML Document.  This node must be a child of
    # Psych::Nodes::Stream.  A Psych::Nodes::Document must have one child,
    # and that child may be one of the following:
    #
    # * Psych::Nodes::Sequence
    # * Psych::Nodes::Mapping
    # * Psych::Nodes::Scalar
    class Document < Psych::Nodes::Node
      # The version of the YAML document
      attr_accessor :version

      # A list of tag directives for this document
      attr_accessor :tag_directives

      # Was this document implicitly created?
      attr_accessor :implicit

      # Is the end of the document implicit?
      attr_accessor :implicit_end

      ###
      # Create a new Psych::Nodes::Document object.
      #
      # +version+ is a list indicating the YAML version.
      # +tags_directives+ is a list of tag directive declarations
      # +implicit+ is a flag indicating whether the document will be implicitly
      # started.
      #
      # == Example:
      # This creates a YAML document object that represents a YAML 1.1 document
      # with one tag directive, and has an implicit start:
      #
      #   Psych::Nodes::Document.new(
      #     [1,1],
      #     [["!", "tag:tenderlovemaking.com,2009:"]],
      #     true
      #   )
      #
      # == See Also
      # See also Psych::Handler#start_document
      def initialize version = [], tag_directives = [], implicit = false
        super()
        @version        = version
        @tag_directives = tag_directives
        @implicit       = implicit
        @implicit_end   = true
      end

      ###
      # Returns the root node.  A Document may only have one root node:
      # http://yaml.org/spec/1.1/#id898031
      def root
        children.first
      end
    end
  end
end

Version data entries

115 entries across 87 versions & 7 rubygems

Version Path
second_step-0.1.2 secondstep-notify-1.0.0-osx/lib/ruby/lib/ruby/gems/2.2.0/gems/second_step-0.1.1/secondstep-notify-1.0.0-osx/lib/ruby/lib/ruby/2.2.0/psych/nodes/document.rb
second_step-0.1.2 secondstep-notify-1.0.0-osx/lib/ruby/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.60 bin/traveling-ruby-2.2.2/osx/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.60 bin/traveling-ruby-2.2.2/l64/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.60 bin/traveling-ruby-2.2.2/l32/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.60 bin/traveling-ruby-2.2.2/win/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.58 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.57 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.56 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.55 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.54 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.53 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.52 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.51 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.50 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.49 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.47 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.46 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.45 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb
rb2exe-0.1.44 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb