TLDR; Array, Set and SortedSet reflect various data structures created for different purposes. It’s good to know their pros and cons and, based on them, be able to select the one which fulfils concrete requirements best. Sometimes there is almost no difference, but there are cases where Set & SortedSet are much faster (and more suitable) than Array and Read more…
TIL that Ruby, or to be more precise Class class, offers allocate public instance method. According to the documentation the method: Allocates space for a new object of class’s class and does not call initialize on the new instance. The returned object must be an instance of class. The same documentation includes a nice code Read more…
Today I learned that HTTParty gem has a built-in option for enabling logging details of all requests made by the gem.
If you have Gemfile file in your repository you know what Bundler is.
Today I was looking for the best way to invoke dynamic class method. After some reading and testing I found a few less and more effective ways.
We recently have switched one of our apps to Ruby 2.2 and I did not know what exactly is behind it so I decided to do a research and learn something new. A detailed list of changes introduced in version 2.2 can be found in Github.
RSpec is a testing framework for Behaviour Driven Development that is composed of multiple libraries. In my current job, for testing Ruby on Rails application, we use rspec-rails gem that installs also all other libraries: rspec-core, rspec-exceptations, rspec-mocks and rspec-support.
It is always nice to do the same thing in a better and quicker way. A problem that occurs quite often in my everyday work is converting a hash to an array of hashes with a different structure.