In Files

Parent

Namespace

Methods

Included Modules

Files

Class/Module Index [+]

Quicksearch

Ya2YAML

Author

Akira FUNAI

Copyright

Copyright © 2006-2010 Akira FUNAI

License

MIT License

Public Class Methods

new(opts = {}) click to toggle source
# File lib/ya2yaml.rb, line 8
def initialize(opts = {})
  options = opts.dup
  options[:indent_size] = 2          if options[:indent_size].to_i <= 0
  options[:minimum_block_length] = 0 if options[:minimum_block_length].to_i <= 0
  options.update(
    {
      :printable_with_syck  => true,
      :escape_b_specific    => true,
      :escape_as_utf8       => true,
    }
  ) if options[:syck_compatible]

  @options = options
end

Public Instance Methods

_ya2yaml(obj) click to toggle source
# File lib/ya2yaml.rb, line 23
def _ya2yaml(obj)
  raise 'set $KCODE to "UTF8".' if (RUBY_VERSION < '1.9.0') && ($KCODE != 'UTF8')
  '--- ' + emit(obj, 1) + "\n"
rescue SystemStackError
  raise ArgumentError, "ya2yaml can't handle circular references"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.