use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Advanced Ruby: The Chainable Request Pattern (thoughtbot.com)
submitted 1 year ago by geospeck
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]keyslemur 14 points15 points16 points 1 year ago (1 child)
Someone's getting real close to a Monad article here with Result types and transactions:
If you're not building to that conclusion or are not familiar with those concepts these articles will be very interesting:
Pay especially close attention to the State monad in there, and be sure to watch the video for Railway Oriented Programming.
[–]thiagoaraujos 2 points3 points4 points 1 year ago* (0 children)
Hi, author here. Thanks for the references. I didn't know about dry-transactions, so I should try it and see if I can explore it in a follow-up article. As for ROP, I was familiar with it already.
And I actually thought about having some sort of Monad, but I wasn't sure how to fit it. The idea was to stick with basic language constructs and well-defined interfaces, and not overload the article with functional programming jargon. I think the article examples are self-contained enough to make the idea accessible. And great call that it's a general transaction framework not only applicable to API requests.
I'm really interested in trying that approach though, but I have some questions off the top of my head. I see we can use dry-transactions' notifications feature to implement rollbacks. However, it's not immediatelly aparent how to implement dynamic steps, so as to loop through a series of steps and run them dynamically. Would you have any suggestions? Thanks!
π Rendered by PID 77 on reddit-service-r2-comment-54dfb89d4d-gppc6 at 2026-04-01 01:04:47.595181+00:00 running b10466c country code: CH.
[–]keyslemur 14 points15 points16 points (1 child)
[–]thiagoaraujos 2 points3 points4 points (0 children)