Another way is to build pipeline via chainable_methods gem.
Described in the article
require 'chainable_methods'
module SimpleMath
include ChainableMethods
def add(a, b=0)
a + b
end
def subtract(a, b=0)
a - b
end
end
SimpleMath.
chain_from(5).
add(5).
add(5).
subtract(3).
unwrap