Created
April 3, 2014 23:37
-
-
Save PDegenPortnoy/9965032 to your computer and use it in GitHub Desktop.
Using a facade examplee
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
links, entries = [], [] | |
data["entityView"].each do |elem| | |
case elem | |
when "links" | |
elem.each{|e| links << Link.new(e)} | |
when "entries" | |
elem.each{|e| entries << Entry.new(e)} | |
else | |
raise "Unknown Element!" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment