Blog post discussing some of the changes/commits I made 😊
Getting started:
Related tutorials:
You're taking your first steps into Ruby
A good introduction to programming in general. Easy on newer programmers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require_relative 'tuple_space' | |
| class Cache | |
| def initialize | |
| @memory = TupleSpace.new(reaper_period_in_secs: 10, expires_in_secs: 60) | |
| end | |
| def get(request) | |
| @memory[request] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require_relative 'tuple_space' | |
| class Cache | |
| def initialize | |
| @memory = TupleSpace.new(reaper_period_in_secs: 10, expires_in_secs: 60) | |
| end | |
| def get(request) | |
| @memory[request] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| COUNTRY_LETTERS = 'A'.upto('Z').each.with_index(127462).to_h.freeze | |
| def country_emoji(iso) | |
| COUNTRY_LETTERS.values_at(*iso.chars).pack('U*') | |
| end | |
| country_emoji('GB') | |
| #=> "🇬🇧" |