Ruby on Rails Tuesday, December 23, 2014

On Tue, Dec 23, 2014 at 9:50 PM, Roman Yarygin <lists@ruby-forum.com> wrote:

> Hello! For example, I have array:
>
> [["can", ":manage", ":site", nil],
> ["can", ":view", ":dashboard", nil],
> ["cannot", ":manage", ":site", nil]]
>
> And I want to remove ["can", ":manage", ":site", nil] element, basing on
> that ":manage" and ":site" elements are equal, but "cannot" element
> appears later than "can". How can i achieve that?

Use the middle two elements as a hash key.

-Dave

--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHxKQihpu514eqxj1PLdkYwDgzYfTpOm8AvwnKAkYccQKbapYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment