Skip to content

Instantly share code, notes, and snippets.

@razielgn
Created August 10, 2011 08:51
Show Gist options
  • Save razielgn/1136399 to your computer and use it in GitHub Desktop.
Save razielgn/1136399 to your computer and use it in GitHub Desktop.
require 'yaml'
#require 'mongoid'
class Bump
attr_reader :data
def initialize
@data = [1,2,3,4,5]
end
end
class Doc
attr_accessor :id
def initialize
@id = Bump.new
end
end
a = Doc.new
puts "\n\nWRONG:"
puts a.to_yaml
class << a.id.data
def to_yaml_style; :inline; end
end
puts "\n\nRIGHT:"
puts a.to_yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment