Does anyone remember where idea of passing Has forward & adding to it comes from?

7 views
Skip to first unread message

Steve Jorgensen

unread,
May 26, 2016, 3:44:53 AM5/26/16
to pdx...@googlegroups.com
Hi all,

I think it was a Ruby Rogues guest who described a practice of passing a
Hash through several stages of processing and having each stage add
items to the Hash. Does anyone remember the source of that?

I'm asking because I just came up with a situation where the same
pattern turned out to be an excellent fit, except that now I'm using
Ruby 2.x keywords and double-splat, which makes that pattern much
cleaner, IMO. I'd like to write a blog post about that, and I want to
give credit to where the original idea came from.

Thanks,

-- Steve J.

Sam Livingston-Gray

unread,
May 26, 2016, 4:37:16 PM5/26/16
to Steve Jorgensen, Portland Ruby Brigade
On Thu, May 26, 2016 at 12:44 AM, Steve Jorgensen <ste...@stevej.name> wrote:
I think it was a Ruby Rogues guest who described a practice of passing a Hash through several stages of processing and having each stage add items to the Hash. Does anyone remember the source of that?
 
I vaguely remember something about this as well, but it's awfully difficult to search the archives for.  (Fortunately, RR has transcribed all their shows, which makes it possible to do a search on "site:devchat.tv"!)

I think maybe this is what you're talking about?  

But if you can separate logic, you make your models rather dumb and do very little but treat them more as like just structs, like something that just holds data and you pass those into a class that actually does the transformation that can make those class do the transformations, pure class. They take data in the form of models or hashes or structs or what-have-you and then spit out what needs to go to the view.

John Hyland

unread,
May 26, 2016, 5:07:03 PM5/26/16
to Sam Livingston-Gray, Steve Jorgensen, Portland Ruby Brigade
I'm not sure I know the specific concept you're referencing, but Rack has been around since before the Ruby Rogues were a thing, and sounds like it fits the pattern you're describing. I _think_ I recall that Rack's design is based on one taken from a Python framework -- maybe Twisted?

--
You received this message because you are subscribed to the Google Groups "pdxruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdxruby+u...@googlegroups.com.
To post to this group, send email to pdx...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdxruby/CAAZV8Fgo6EfH0n2NYefa3OASrAeUxV9pnDakYT4JSxLko4j3ag%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Sam Livingston-Gray

unread,
May 26, 2016, 5:12:37 PM5/26/16
to John Hyland, Steve Jorgensen, Portland Ruby Brigade
On Thu, May 26, 2016 at 2:06 PM, John Hyland <djspin...@gmail.com> wrote:
I _think_ I recall that Rack's design is based on one taken from a Python framework -- maybe Twisted?

From what I can tell, Rack is more or less the equivalent of Python's WSGI.  (Disclaimer: I haven't written Python in about a decade.)  https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface

Johnneylee Jack Rollins

unread,
May 26, 2016, 10:27:16 PM5/26/16
to Steve Jorgensen, pdx...@googlegroups.com
Perhaps you're looking for something related to pipelines?

http://martinfowler.com/articles/collection-pipeline/

~Johnneylee

On Thu, May 26, 2016 at 12:44 AM, Steve Jorgensen <ste...@stevej.name> wrote:
> --
> You received this message because you are subscribed to the Google Groups
> "pdxruby" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pdxruby+u...@googlegroups.com.
> To post to this group, send email to pdx...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pdxruby/07eabb8f-d2ac-fa0f-048b-200e757e15b7%40stevej.name.
Reply all
Reply to author
Forward
0 new messages