FirstDEV blog
  • Home
  • Ruby
  • Ruby On Rails
  • Tips
  • Solutions
  • About
Subscribe

Ruby 3

A collection of 29 posts

Ruby 3

Hash Methods Worth Knowing — transform_keys, transform_values, filter, and merge with a Block

Hashes are the workhorse data structure of most Ruby applications — API responses, configuration objects, parameters, aggregations. Ruby’s Hash class has been steadily gaining methods that reduce the boilerplate of common transformations. transform_keys,

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby 3

filter_map and Modern Enumerable — Ruby's Most Useful Recent Additions

Ruby’s Enumerable module has been quietly gaining methods that make common collection operations more expressive without adding complexity. filter_map alone replaces a pattern that every Ruby developer has written dozens of times. Combined

Rajan Bhattarai Rajan Bhattarai 11 min read
Ruby 3

Ruby String Methods You're Probably Underusing — format, scan, match, and gsub with Blocks

String manipulation is one of those areas where developers develop habits early and rarely revisit them. split, include?, gsub, strip — these cover a lot of ground. But Ruby’s String class has methods

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby 3

Method Objects in Ruby — Treating Methods as First-Class Values

Ruby methods are first-class citizens in a way that most developers don’t fully use. You can grab a method as an object, pass it around, convert it to a proc, unbind it from

Rajan Bhattarai Rajan Bhattarai 9 min read
Ruby 3

Ruby Threads and Thread Safety — Practical Concurrency Without the Chaos

Threads in Ruby have a complicated reputation — partly because of the Global Interpreter Lock (GIL) in MRI Ruby, partly because concurrent code genuinely is harder to reason about, and partly because most

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby 3

Metaprogramming with define_method — Writing Code That Writes Code in Ruby

Metaprogramming gets a reputation for being either magic or dangerous, depending on who you ask. Used carelessly, it produces code that’s impossible to trace and impossible to test. Used deliberately, it eliminates repetitive

Rajan Bhattarai Rajan Bhattarai 9 min read
Ruby 3

Proc vs Lambda in Ruby — Two Callable Objects, Different Rules

Ruby has two closely related callable objects — Proc and lambda — and the difference between them trips up developers more than almost any other Ruby concept. They look similar, they’re both instances

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby 3

Range Objects in Ruby — More Than Just Iteration

Most Ruby developers use ranges for iteration and not much else. (1..10).each, maybe ('a'..'z') for alphabet work, perhaps a case condition or two. But ranges in Ruby are full objects with a rich

Rajan Bhattarai Rajan Bhattarai 9 min read
Ruby 3

Struct vs OpenStruct vs Data — Choosing Lightweight Value Objects in Ruby

Ruby gives you three tools for creating lightweight objects without the boilerplate of a full class definition: Struct, OpenStruct, and the newer Data (Ruby 3.2+). Each serves a different purpose, and the wrong

Rajan Bhattarai Rajan Bhattarai 11 min read
Page 1 of 4 Older Posts »
FirstDEV blog © 2026
Proudly published with Jekyll & using Jasper2
Latest Posts Twitter
FirstDEV blog

Check viewARU - Brand Newsletter!

Newsletter to DEVs by DEVs - boost your Personal Brand & career! 🚀