Re: Final iteration lost?
Leam Hall <[email protected]> Mon, 12 Aug 2019 07:31:32 -0400
| Newsgroups | gmane.comp.lang.ruby.general |
|---|---|
| Message-ID | <[email protected]> |
On 8/8/19 3:59 PM, John W Higgins wrote: > > The better option here is to create a "job" and have it process > the rows as opposed to processing rows and then creating a job Leam replied: > John, just a quick reply on this. I'm still very much a Ruby beginner, > your solution took me a couple reads to begin to understand. I think > it's brilliant, and will work to understand it more. On 8/11/19 9:53 AM, Robert Klemme then wrote: > I would add one caveat: John's approach adds knowledge about the > formatting to class Job. To which Leam replies: Understood. My biggest hurdle was to get the object to accumulate all the sub-sections without losing the last one, and preferably without additional post-processing. There are a variable number of sub-sections, and that was my trouble-spot. The regex parsing before, and the presentation after, should not be a part of the Job class. Thanks! Leam Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>