Module: CrazyHarry::Truncate

Included in:
Base
Defined in:
lib/crazy_harry/truncate.rb

Instance Method Summary collapse

Instance Method Details

#truncate!(count, opts = {}) ⇒ Object



4
5
6
7
8
# File 'lib/crazy_harry/truncate.rb', line 4

def truncate!(count, opts = {})
  truncated = HTML_Truncator.truncate(self.fragment.to_s, count, opts)
  self.fragment = Loofah.fragment(truncated)
  self
end