Sha256: bf57e903bc8ec7f24c93777b3212849da3990e5e59ec3ade0f157f3c0a1c90d4

Contents?: true

Size: 1.57 KB

Versions: 115

Compression:

Stored size: 1.57 KB

Contents

module Psych
  module Nodes
    ###
    # This class represents a {YAML Scalar}[http://yaml.org/spec/1.1/#id858081].
    #
    # This node type is a terminal node and should not have any children.
    class Scalar < Psych::Nodes::Node
      # Any style scalar, the emitter chooses
      ANY           = 0

      # Plain scalar style
      PLAIN         = 1

      # Single quoted style
      SINGLE_QUOTED = 2

      # Double quoted style
      DOUBLE_QUOTED = 3

      # Literal style
      LITERAL       = 4

      # Folded style
      FOLDED        = 5

      # The scalar value
      attr_accessor :value

      # The anchor value (if there is one)
      attr_accessor :anchor

      # The tag value (if there is one)
      attr_accessor :tag

      # Is this a plain scalar?
      attr_accessor :plain

      # Is this scalar quoted?
      attr_accessor :quoted

      # The style of this scalar
      attr_accessor :style

      ###
      # Create a new Psych::Nodes::Scalar object.
      #
      # +value+ is the string value of the scalar
      # +anchor+ is an associated anchor or nil
      # +tag+ is an associated tag or nil
      # +plain+ is a boolean value
      # +quoted+ is a boolean value
      # +style+ is an integer idicating the string style
      #
      # == See Also
      #
      # See also Psych::Handler#scalar
      def initialize value, anchor = nil, tag = nil, plain = true, quoted = false, style = ANY
        @value  = value
        @anchor = anchor
        @tag    = tag
        @plain  = plain
        @quoted = quoted
        @style  = style
      end
    end
  end
end

Version data entries

115 entries across 87 versions & 7 rubygems

Version Path
psych-2.0.10 lib/psych/nodes/scalar.rb
psych-2.0.9 lib/psych/nodes/scalar.rb
psych-2.0.8 lib/psych/nodes/scalar.rb
psych-2.0.7 lib/psych/nodes/scalar.rb
psych-2.0.6 lib/psych/nodes/scalar.rb
psych-shopifork-2.0.5 lib/psych/nodes/scalar.rb
psych-2.0.5 lib/psych/nodes/scalar.rb
psych-2.0.4 lib/psych/nodes/scalar.rb
psych-shopifork-2.0.3 lib/psych/nodes/scalar.rb
psych-2.0.3 lib/psych/nodes/scalar.rb
psych-2.0.2 lib/psych/nodes/scalar.rb
psych-shopifork-2.0.0 lib/psych/nodes/scalar.rb
psych-2.0.1 lib/psych/nodes/scalar.rb
sauce_whisk-0.0.10 vendor/psych/lib/psych/nodes/scalar.rb
sauce_whisk-0.0.9 vendor/psych/lib/psych/nodes/scalar.rb
psych-2.0.0 lib/psych/nodes/scalar.rb
sauce_whisk-0.0.8 vendor/psych/lib/psych/nodes/scalar.rb
sauce_whisk-0.0.7 vendor/psych/lib/psych/nodes/scalar.rb
sauce_whisk-0.0.5 vendor/psych/lib/psych/nodes/scalar.rb
sauce_whisk-0.0.4 vendor/psych/lib/psych/nodes/scalar.rb