Created
August 20, 2017 21:12
-
-
Save anonymous/b91f1525ecdbef50da1842ebcbf3975d to your computer and use it in GitHub Desktop.
Let's say I have 2 arrays, one is like a pack of cigarrette with different brands of ciggarrettes and second array is like a dozen of different brand of cigarrette packs, and I want to be able to pick a pack of malboro from the second array if someone pick a stick of malboro from first array. I think I can use subscribe method to do it but it lo…
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
sticks.collect do |stick| | |
stick.brand | |
Packs.collect do |pack| | |
pack.brand == stick.brand | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have:
I want: