A bit of (personal) history I learned Ruby, I think, around 2007, and back then, it was a language pushing boundaries for me. Before encountering Ruby, I worked with Java, C/C++...
A bit of (personal) history I learned Ruby, I think, around 2007, and back then, it was a language pushing boundaries for me. Before encountering Ruby, I worked with Java, C/C++...
This is primarily a response to a Reddit comment but I have encountered this line of pushback against short-hand syntax multiple times. Thus I think it is good to write it down ...
I like to use as much as possible the new features in Ruby. In this case, I will show how to take advantage of shorthand hash syntax whileThe on changing from instance variables...
Code Design Inertia: The code that will be written in the future will follow the design of the code already written. Inertia is stronger inside a file => the code added will f...
When thinking about testing, consider the following points: You are not writing tests only for yourself but also for other developers who might join your project. They might co...
If you want to freeze strings in Ruby there are at least two ways to do this: 1) Adding the magic comment at the beginning of the file # frozen_string_literal: true 2) Calling ...
How to get the class name To get the class name: class User def call = puts self.class.name end User.new.call #=> User This will work even if the name is namespace inside a m...
Rails 7 introduced a new way to create enums in PostgreSQL, by adding create_enum method. See official documentation here. I will explore the following tasks: Creating an enum ...
I will try to explain what a class is in some other way, somehow quoting or paraphrasing in some parts what @steveklabnik said a very long time ago in a presentation about OOP i...
I think learning Ruby has three parts: OOP + SOLID in Ruby Ruby Syntax Idiomatic Ruby What follows assumes you already know how to program in any other programming language...
You can also subscribe with RSS!