Ruby

Showing 1-9 of 21 results
EngineeringIcon ChevronBack-end

An Array of Possibilities: A Guide to Ruby Pattern Matching

by Noppakun Wongsrinoppakun

Pattern matching is a powerful tool commonly found in functional programming languages. The Ruby 2.7 release is going to include this feature. In this article, Toptal Ruby Developer Noppakun Wongsrinoppakun provides a breakdown of what this addition will include and why it matters.

8 minute readContinue Reading
EngineeringIcon ChevronBack-end

Ruby Algorithm Documentation with AsciiDoc and Knitr

by Alec Ten Harmsel

A functional specification is a high-level design document created before implementation and serves as a true plan for the team. In this article, Toptal Freelance Ruby Developer Alec Ten Harmsel walks us through prototyping an algorithm and creating a functional specification with the help of AsciiDoc and R for a Ruby on Rails project.

5 minute readContinue Reading
EngineeringIcon ChevronBack-end

Option/Maybe, Either, and Future Monads in JavaScript, Python, Ruby, Swift, and Scala

by Alexey Karasev

If you're searching for the holy grail of bug-free code in JavaScript, Python, Ruby, Swift, and/or Scala, look no further! This monad tutorial by Toptal Freelance Functional Programmer Alexey Karasev takes you from category theory to the practical implementations of the Option/Maybe, Either, and Future monads, plus a sample program—in all five languages.

23 minute readContinue Reading
EngineeringIcon ChevronBack-end

Rails Service Objects: A Comprehensive Guide

by Amin Shah Gilani

Rails ships with everything you need to prototype your application quickly, but when your codebase starts growing, you'll run into scenarios where the conventional Fat Model, Skinny Controller mantra breaks. When your business logic can't fit in either a model or a controller, that's when service objects come in and let us separate every business action into its own Ruby object.

11 minute readContinue Reading
EngineeringIcon ChevronBack-end

Field-level Rails Cache Invalidation: A DSL Solution

by Botond Orban

Fragment caching in Rails provides an easy yet a powerful way of improving your application's performance. However, some real-world scenarios do not work quite well with how the Rails cache behaves by default. In this article, Toptal Ruby on Rails Developer Orban Botond shows how you can implement a small DSL to optimize how the cache for related entities is invalidated to improve template rendering performance.

7 minute readContinue Reading
EngineeringIcon ChevronBack-end

Creating a Ruby DSL: A Guide to Advanced Metaprogramming

by Máté Solymosi

Write better Ruby code by leveraging its metaprogramming features. In this article, you will learn how to create your own Ruby domain specific language (DSL).

15 minute readContinue Reading
EngineeringIcon ChevronBack-end

Build Sleek Rails Components With Plain Old Ruby Objects

by Eqbal Quran

Your website is gaining traction, and you are growing rapidly. Ruby/Rails is your programming language of choice. Your team is bigger and you’ve given up on “fat models, skinny controllers” as a design style for your Rails apps. However, you still don’t want to abandon using Rails? No problem. In this article, Toptal Software Engineer Eqbal Quran explains how you can decouple and isolate your Rails components using nothing Plain Old Ruby Objects. Ruby objects and abstractions can decouple concerns, simplify testing, and help you produce clean, maintainable code.

18 minute readContinue Reading
EngineeringIcon ChevronBack-end

How Sequel and Sinatra Solve Ruby’s API Problem

by Boško Ivanišević

The rise of the web and mobile applications has led to an increased need for back-end API services. Ruby on Rails' philosophy seemingly makes it the ideal framework for creating back-end APIs. However, using Rails only for the API is overkill. In this article, Freelance Software Engineer Boško Ivanišević explores alternatives to Rails and introduces us to two very mature and powerful gems, Sinatra and Sequel, which in combination provide powerful tools for creating server-side APIs.

9 minute readContinue Reading
EngineeringIcon ChevronBack-end

Social Network APIs: The Internet’s Portal to the Real World

by Behsaad Ramez

Social networks are a rich source of user information. From a person’s current mood to endless streams of photos, there is by now probably a social network for each aspect of human life. From the development side, access to users' information can be an essential element in providing a truly personalized experience in any application. In this article, Toptal Freelance Software Engineer Behsaad Ramez shows us how the APIs of some of these social networks stack against each other and how they may be leveraged to accumulate precious information about users.

14 minute readContinue Reading

Join the Toptal® community.