--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Wraps the <tt>text</tt> into lines no longer than <tt>line_width</tt> width. This method breaks on the first whitespace character that does not exceed <tt>line_width</tt> (which is 80 by default).
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  word_wrap('Once upon a time')\n  # =&gt; Once upon a time\n\n  word_wrap('Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding a successor to the throne turned out to be more trouble than anyone could have imagined...')\n  # =&gt; Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding\\n a successor to the throne turned out to be more trouble than anyone could have\\n imagined...\n\n  word_wrap('Once upon a time', :line_width =&gt; 8)\n  # =&gt; Once upon\\na time\n\n  word_wrap('Once upon a time', :line_width =&gt; 1)\n  # =&gt; Once\\nupon\\na\\ntime\n"
- !ruby/struct:SM::Flow::P 
  body: "You can still use <tt>word_wrap</tt> with the old API that accepts the <tt>line_width</tt> as its optional second parameter:"
- !ruby/struct:SM::Flow::VERB 
  body: "  word_wrap('Once upon a time', 8)     # =&gt; Once upon\\na time\n"
full_name: ActionView::Helpers::TextHelper#word_wrap
is_singleton: false
name: word_wrap
params: (text, *args)
visibility: public
