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...
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...
Context Let's say I am working on a project named "short-ruby" 😉 That project is currently located somewhere like /home/lucian/projects/short-ruby Let's say that I am currentl...
I read this article about DRY and this prompted me to write some thoughts about this. This was a very debated article about what is DRY and what it means to use it or not and th...
Imagine you are taking part in a coding competition. Let’s explore what it might look like. You found this contest online and registered to participate. On the day of the event,...
I shared this first as a thread on Twitter but I think I want to document it also here: https://twitter.com/lucianghinda/status/1518594459189104640 Courses and Trainings https...
If you just started to learn a programming language and web framework, here is my suggestion about what to work on: What project to work on Choose a successful SaaS product tha...
How do these things work? Have you ever wondered how the following code works? Specifically, how come the key will have another value than true or false. key = loaded_key || Ke...
You can also subscribe with RSS!