module Kernel

Private Instance Methods

y( object, *objects ) click to toggle source

Prints any supplied objects out in YAML. Intended as a variation on Kernel::p.

S = Struct.new(:name, :state)
s = S['dave', 'TX']
y s

produces:

--- !ruby/struct:S
name: dave
state: TX
# File lib/syck.rb, line 442
def y( object, *objects )
    objects.unshift object
    puts( if objects.length == 1
              Syck.dump( *objects )
          else
              Syck.dump_stream( *objects )
          end )
end