Class: Shoulda::Matchers::Document
- Inherits:
-
Object
- Object
- Shoulda::Matchers::Document
- Defined in:
- lib/shoulda/matchers/util/word_wrap.rb
Instance Method Summary collapse
-
#initialize(document, indent: 0) ⇒ Document
constructor
A new instance of Document.
- #wrap ⇒ Object
Constructor Details
#initialize(document, indent: 0) ⇒ Document
Returns a new instance of Document.
16 17 18 19 |
# File 'lib/shoulda/matchers/util/word_wrap.rb', line 16 def initialize(document, indent: 0) @document = document @indent = indent end |
Instance Method Details
#wrap ⇒ Object
21 22 23 |
# File 'lib/shoulda/matchers/util/word_wrap.rb', line 21 def wrap wrapped_paragraphs.map { |lines| lines.join("\n") }.join("\n\n") end |