Created
August 10, 2011 08:51
-
-
Save razielgn/1136399 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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