---
title: "Discussion on \"Memoization in Ruby\" | Hashnode"
description: "Discussion on \"Memoization in Ruby\". Memoization is useful when you have some code that is used multiple times to avoid computing it each time. \nSuppose the following example:\nclass Employee\n\n  def salary\n    CalculateSalary.call(employee: self)\n  end\n\n  def salary_per_hour\n    # for si..."
url: "https://hashnode.com/posts/memoization-in-ruby/607d1fc2c99e200d08f7ded7"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Memoization in Ruby](https://kaizencodes.io/memoization-in-ruby?utm_source=hashnode&utm_medium=feed)

Memoization is useful when you have some code that is used multiple times to avoid computing it each time. Suppose the following example: class Employee def salary CalculateSalary.call(employee: self) end def salary\_per\_hour # for si...

Apr 19, 2021 · 3 min read · kaizencodes.io  
Read the article

-   [#ruby](https://hashnode.com/tag/ruby)

## Written by

[Daniel Szatmari](https://hashnode.com/@kaizencodes)

@kaizencodes · UK

  
[View profile](https://hashnode.com/@kaizencodes)

commiting improvement

The last 5 years I worked as a web developer. The framework for most of the projects were Ruby on Rails. On the side I like to learn about AI and web security. I try to keep up with our ever changing world by reading and listening to books, posts, tweets. Audio-books are great for commutes, going for a run, working out, or standing in line at the grocery store. You can spend time learning new things when you can’t do much else. I also like to play the piano.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
