Method: Hobix::BaseContent#to_yaml

Defined in:
lib/hobix/base.rb

#to_yaml(opts = {}) ⇒ Object



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/hobix/base.rb', line 392

def to_yaml( opts = {} )
    opts[:UseFold] = true if opts.respond_to? :[]
    self.class.text_processor_fields.each do |f|
        v = instance_variable_get( '@' + f )
        if v.is_a? self.class.text_processor
            instance_eval %{
                def @#{ f }.to_yaml( opts = {} )
                    s = self.to_str
                    def s.to_yaml_style; :literal; end
                    s.to_yaml( opts )
                end
            }
        end
    end
    to_yaml_orig( opts )
end