Akira FUNAI
Copyright © 2006-2010 Akira FUNAI
MIT License
# 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
# 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