Replace a key in a ruby hash
If you have a perfectly good hash, that you got from another function, but for some reason, you need to change the key(s) in it, there is a simple one liner: So, you have to […]
If you have a perfectly good hash, that you got from another function, but for some reason, you need to change the key(s) in it, there is a simple one liner: So, you have to […]
Ruby lambdas are typical lambda: you can assign them to a variable, call them and use them as closures. To declare a lambda:option 1, using the lambda keyword: This is fairly simple, and in order […]
If you have a case statement and you need to determinate the type, you can’t use something like this: If you’ll run irb and try it with ==, it will work, but not in a […]