class YAMLRepro::TreeBuilder

Constants

Scalar

Attributes

next_collection_style[W]

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/xmigra.rb, line 95
def initialize(*args)
  super
  @next_collection_style = nil
end

Public Instance Methods

next_collection_style(default_style) click to toggle source
# File lib/xmigra.rb, line 100
def next_collection_style(default_style)
  style = @next_collection_style || default_style
  @next_collection_style = nil
  style
end
scalar(value, anchor, tag, plain, quoted, style) click to toggle source
Calls superclass method
# File lib/xmigra.rb, line 106
def scalar(value, anchor, tag, plain, quoted, style)
  if style_any?(style) and value.respond_to?(:yaml_style) and style = value.yaml_style
    if style_block_scalar?(style)
      plain = false
      quoted = true
    end
  end
  super
end
style_any?(style) click to toggle source
# File lib/xmigra.rb, line 116
def style_any?(style)
  Scalar::ANY == style
end
style_block_scalar?(style) click to toggle source
# File lib/xmigra.rb, line 120
def style_block_scalar?(style)
  [Scalar::LITERAL, Scalar::FOLDED].include? style
end