Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/wrapify.rb
Instance Method Summary collapse
-
#wrap_to_limit(wrap_limit) ⇒ Object
doc1_ wrapped = <<-RESULT line 1 contains a lot of stuff line 2 contains even more, which we will wrap to a fixed short line 3 boundry if we are lucky.
Instance Method Details
#wrap_to_limit(wrap_limit) ⇒ Object
doc1_ wrapped = <<-RESULT line 1 contains a lot of stuff line 2 contains even more, which we will wrap to a fixed short line 3 boundry if we are lucky. Who knows what will really happen. line 4 RESULT
34 35 36 37 |
# File 'lib/wrapify.rb', line 34 def wrap_to_limit(wrap_limit) str = self.gsub(/\s+/, ' ') # convert runs of white space to single space String.wrap_process(str, wrap_limit) end |