Created
October 11, 2016 11:00
-
-
Save ryosuke-endo/e62e1dfc50fd65ed77a4241b37105a18 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
class Family | |
def self.build | |
yield | |
end | |
end | |
x = Family.build do |family| | |
family.new_child('john') do |child| | |
child.hobby = 'game' | |
child.age = 18 | |
end | |
family.new_child('yamada') do |child| | |
child.hobby = 'study' | |
child.age = 12 | |
end | |
end | |
x.children |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
やり直した