An example Ruby program to demonstrate the "pure function as an object" pattern.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Pure Function As An Object (PFAAO) Pattern Demonstration

This is a tiny project to demonstrate the PFAAO pattern. It converts a JSON document to an XML document. The accompanying article article is available here:

Running The Code

First, install the dependencies with:

bundle install

Then run the code with:

bundle exec ruby convert.rb


The input.json data set comes from JSON Studio website:

This pattern is inspired and influenced by all of Rich Hickey's Clojure talks and Casey Muratori's API design talks.