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

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Truncates a given <tt>text</tt> after a given <tt>:length</tt> if <tt>text</tt> is longer than <tt>:length</tt> (defaults to 30). The last characters will be replaced with the <tt>:omission</tt> (defaults to &quot;...&quot;) for a total length not exceeding <tt>:length</tt>.
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  truncate(&quot;Once upon a time in a world far far away&quot;)\n  # =&gt; Once upon a time in a world...\n\n  truncate(&quot;Once upon a time in a world far far away&quot;, :length =&gt; 14)\n  # =&gt; Once upon a...\n\n  truncate(&quot;And they found that many people were sleeping better.&quot;, :length =&gt; 25, &quot;(clipped)&quot;)\n  # =&gt; And they found t(clipped)\n\n  truncate(&quot;And they found that many people were sleeping better.&quot;, :omission =&gt; &quot;... (continued)&quot;, :length =&gt; 25)\n  # =&gt; And they f... (continued)\n"
- !ruby/struct:SM::Flow::P 
  body: "You can still use <tt>truncate</tt> with the old API that accepts the <tt>length</tt> as its optional second and the <tt>ellipsis</tt> as its optional third parameter:"
- !ruby/struct:SM::Flow::VERB 
  body: "  truncate(&quot;Once upon a time in a world far far away&quot;, 14)\n  # =&gt; Once upon a...\n\n  truncate(&quot;And they found that many people were sleeping better.&quot;, 25, &quot;... (continued)&quot;)\n  # =&gt; And they f... (continued)\n"
full_name: ActionView::Helpers::TextHelper#truncate
is_singleton: false
name: truncate
params: (text, *args)
visibility: public
