FirstDEV blog
  • Home
  • Ruby
  • Ruby On Rails
  • Tips
  • Solutions
  • About
Subscribe

Ruby-code

A collection of 2 posts

Ruby-code

Find Intersection Of Arrays Or Sets Cleanly In Ruby 3

Ruby 3+ provides elegant ways to find common elements between arrays, sets, or enum collections using intersection (&) or Set#intersection. This is especially useful for filtering, authorization checks, tag matching, or data deduplication.

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby-code

Group Array Elements By Multiple Attributes In Ruby

Grouping records by a single attribute is straightforward using Enumerable#group_by. But what if you want to group by multiple attributes, such as categorizing records by both type and status? This method handles that

Rajan Bhattarai Rajan Bhattarai 1 min read
FirstDEV blog © 2025
Proudly published with Jekyll & using Jasper2
Latest Posts Twitter
FirstDEV blog

Check viewARU - Brand Newsletter!

Newsletter to DEVs by DEVs — boost your Personal Brand & career! 🚀