Created
June 24, 2010 05:55
-
-
Save ryan-allen/451041 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
module TreeFace | |
def with(object, &block) | |
raise "need an object" if not object | |
object.instance_eval(&block) | |
object | |
end | |
end | |
include TreeFace | |
sites = with(Array.new) do | |
push :flashden | |
push :audiojungle | |
push(with(Hash.new) do | |
self[:name] = 'ThemeForest' | |
self[:url] = 'http://themeforest.net' | |
self[:top_authors] = with(Array.new) do | |
push :john | |
push :ryan | |
push :glen | |
end | |
end) | |
end | |
puts sites.inspect |
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
Faaarrk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment