mouchtaris/forgery — pull request #1 by mouchtaris (2014-12-04 11:45:33+00:00)
Title: Proposition for LoremIpsum::each_paragraph

each_paragraph is essentially factoring-out some of paragraphs' functionality, so that there is better separation of responsibilities, etc. As a free side-effect, we get more flexibility if desired.

each_paragraph takes over the paragraph generation logic, while paragraphs takes over decoration and utility roles. It is essentially a convenience wrapper-method for each_paragraph.

each_paragraph honours the :sentences and :random-related options. paragraphs passes its options to each_paragraph, so they can be "forwarded".

This pull request builds on top of #70, which suggested changing the behaviour of paragraphs so that they yield their decorated paragraphs if a block is given. I raise this pull request as a separate matter but on top of #70 so that the differences of refactoring are clearer and so that it can be discussed separately. In case #70 is rejected, this refactoring is still valid and can be fixed to apply cleanly.