Skip to content

Instantly share code, notes, and snippets.

@PDegenPortnoy
Created April 3, 2014 23:37
Show Gist options
  • Save PDegenPortnoy/9965032 to your computer and use it in GitHub Desktop.
Save PDegenPortnoy/9965032 to your computer and use it in GitHub Desktop.
Using a facade examplee
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