One step closer to a good pipeline operator for Ruby

I’ve previously yearned for something like Elm and Elixir’s |> operator in Ruby. Turns out, this clever bit of concision is in Ruby 2.5: object.yield_self {|x| block } → an_object # Yields self to the block and returns the result of the block. class Object def yield_self yield(self) end end I would prefer then or… Continue reading One step closer to a good pipeline operator for Ruby

Using Rails 3.0's notification system

How to use Rails 3.0’s new notification system to inject custom log events. Ever wondered what the notification/subscription stuff in Rails 3 is? Wonder no more! I just used this to add performance logging around some Cassandra stuff in our Rails 3 app. Once you get the hang of it, this is really rad stuff.

An ode to Hashie

I was building an API wrapper this weekend. As is common when writing these sorts of things, I found myself needing something that takes semi-structured data (hashes parsed from JSON) and yields Ruby objects that are easy to work with. I’ve always found myself hacking these sorts of things together on a somewhat ad-hoc basis.… Continue reading An ode to Hashie

Published
Categorized as Code Tagged

Examining software principles

There are too many good things to say about the Design Principles Behind Smalltalk. A few of my favorites: Scope: The design of a language for using computers must deal with internal models, external media, and the interaction between these in both the human and the computer. This one is really obvious until you get… Continue reading Examining software principles