Struct class in Ruby

Struct is a collection of attributes with accessor methods, without having to write the class explicitly.

2 min read

Dig method in Ruby

#dig method was added in Ruby 2.3 to Array and Hash classes. It makes digging the Array and Hash easy while making the code readable.

~1 min read

Zero-Downtime migrations in Rails

Often, we rename a column and deploy to find out the Honeybadger screaming at us with the errors accessing column with the old name!

1 min read

Hash With Indifferent Access in Rails

When I found out how the params could be accessed using both symbol and string as keys, I dived deep to figure out about ActiveSupport::HashWithIndifferentAccess class in Rails.

1 min read

OpenStruct in Ruby

In Ruby, OpenStruct is a data structure, similar to Hash. With this, we can define attributes with values (key value pairs).

2 min read