Promise.rb

promise.rb is the ruby implementation of Promise/A+.

“promise” is an object or function with a then method whose behavior conforms to this specification.
“thenable” is an object or function that defines a then method.
“value” is any legal JavaScript value (including undefined, a thenable, or a promise).
“exception” is a value that is thrown using the throw statement.
“reason” is a value that indicates why a promise was rejected.

which translates into Ruby:

promise.then(onFulfilled, onRejected)
             ^^^^^^^^^^^------------------ Successful case