Using the Methods You Love in a Language That Is Lacking

Because I switch between ColdFusion and Ruby on a weekly basis, when I work on ColdFusion I sometimes miss some of the features that I have in Ruby. Like having a hash return a nil when a key doesn't exist, rather than getting an error when a key doesn't exist in a struct. Or being able to quickly check if multiple keys exist in a hash.

Enter cf_rubyish, the start of a ColdFusion library of Ruby-esque wrappers. Currently it only has a very basic start to a hash object. As I miss a method from Ruby, I add it to the rhash object, ensuring that the cf_rubyish objects follow the Ruby specifications as closely as possible.

During this process of adding functionality to rhash, I've learned things about Ruby that I didn't know. For example, I learned that you could set the default value a hash returns when a key doesn't exist, so it could be 'foobar' instead of nil.

cf_rubyish is an open source library, so if you are a ColdFusion developer feel free to use the library in your projects. And we always welcome pull requests with new features!