Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/core_ext/string/wrap.rb
Instance Method Summary collapse
Instance Method Details
#wrap(width) ⇒ Object
2 3 4 |
# File 'lib/core_ext/string/wrap.rb', line 2 def wrap(width) gsub(/(.{1,#{width}})( +|$\n?)|(.{1,#{width}})/, "\\1\\3\n") end |