Class: Shoulda::Matchers::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/shoulda/matchers/util/word_wrap.rb

Instance Method Summary collapse

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

#wrapObject



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