Adding example code taken from my blog post @rubygemtsl.com.