As I move between C# and Ruby, I have found my brain’s internal syntax parser always needing to switch gears and repurpose its understanding of Fat Arrow, =>. In Ruby, it provides a visually salient means of expressing key => value pairing within a Hash. C# on the other hand uses it to indicate theContinue reading “Hacking C#’s Lambda Expressions Into Hash Rockets”
Tag Archives: Ruby
Extend Ruby Enumerables With An EachN Processor
Here’s a useful enhancement to arrays that allows you to process elements in a block n at a time. N is inferred by the arity of your block signature. Namaste…
Sleek CLI wrappers around Ruby libs
When using Ruby’s splat operator for method invocation, eg. my_method(*my_array), it takes the array and blows it out into the parameters required to fill the method’s signature. This makes it super easy to call methods from classes via the command line, by simply passing the arguments (ARGV) to a Ruby command line app and thenContinue reading “Sleek CLI wrappers around Ruby libs”