3 posts in total


Posts tagged

Keeping array elements uniq in Ruby

by Syed Aslam · 1 min read

With uniq method you can remove duplicates from an array, however using the bitwise | operator we can avoid adding duplicate items in the first place.

Working with Files in Ruby

by Syed Aslam · 10 min read

The built-in class File provides the facilities for manipulating files in Ruby. Let us explore the basic file operations, including opening, reading, writing along with querying file objects to get information about the file itself.

Loading data from multiple files in Ruby using Hash

by Syed Aslam · 2 min read

There comes a time when you need to load data from multiple sources to futher processing in your application. Let's see how we can do this with ease in this post and load data from multiple files in Ruby using Hash.