Mi opinión: ¿Qué pinta deberían de tener los Service objects en Rails?

¡Muy buenas a todos! Cuánto tiempo, ¿no?. Quizás te preguntes, ¿qué te ha pasado Alberto? La verdad es que llevo años (y lo digo en serio) queriendo acompañar mis posts con videos en YouTube y me prometí que el siguiente post llevaría un vídeo sí o sí… ¡lo que no anticipaba es que me costaría […]

My thoughts: How should service objects in Rails ideally look like?

Hi everybody! What a hiatus, right? If you are asking yourself, what happened to you Alberto? The reality is that for a long time I wanted to included YouTube videos in my post and I promised myself that the next post I published would have a video for sure… what I did not anticipate is […]

News to come!

Hi! This isn’t a technical entry but one to tell you what is going on in my mind. One post to tell you the things I want to introduce into this blog. Things I want to test. Let’s start! Ruby on Rails Since July 2017 I have been contributing to the Ruby on Rails framework… […]

Ruby: Hook methods: the inherited hook

As last week I went to Barcelona and didn’t have enough time in the weekend to properly prepare a larger topic, this week’s post will be short and concise. As a novelty, I will also layout this post in a sort of a record card that may be reused for other hook methods or even patterns in […]

Ruby: The Symbol.to_proc coercion

In on our day to day in Ruby it is very common to apply a method to every object in a collection. Suppose array is a collection of String objects. We are used to write array.map { |elem| elem.upcase }. With this code you invoke map on the array object with a block, the map method will […]

Ruby: Methods defined in Rake tasks

Last week during a code review at work, this thing became a topic again. This time I’ve decided to write a post about it so other colleagues can learn from it and be aware of the potential risks it implies to define methods in your rake files. The next time I need to refer to […]

Ruby: Range#include? vs Range#cover?

When it comes to check if an item is included in a Range, most Ruby programmers tend to use the include? method only. Probably this is because the include? method comes with the Enumerable module and therefore we are used to have it available in several classes. But the Range class comes with a less […]

Phoenix: The request assembly line

Phoenix framework logo

Elixir is a functional language… and Phoenix takes it seriously. The web seems to be a perfect fit for functional languages. You invoke a function passing some arguments and you expect a result, or speaking in web related terms, you make a request to an URL with some parameters and you expect a response. You […]

Print Ruby objects internal state: puts vs p

Today I decided to make a short post about how to print an object’s internal state. puts Usually when we want to print out something in Ruby, the first method that comes to our mind is puts. The method puts prints all the arguments we pass in to it and inserts a new line after each […]

How to tell a good test story with RSpec

The problem Are you having trouble understanding your test suites? Do you find yourself scrolling up and down over a spec file to find where that method comes from? Are your specs difficult to read? If you use RSpec in your daily job I am pretty sure this will sound familiar to you. RSpec is […]