Skip to content

Instantly share code, notes, and snippets.

@yoppi
Created June 2, 2011 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoppi/1004260 to your computer and use it in GitHub Desktop.
Save yoppi/1004260 to your computer and use it in GitHub Desktop.
map/compact/inject
puts_catalog(
conversion,
(1..3).map {|i|
catalog.fetch_hash["m_catalog_category_level3_id#{i}"]
}.compact.inject([]) {|ret, id|
ret << find_catalog_category_level(id)
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment