Module: NokogiriTruncator::TextNode

Defined in:
app/helpers/postablr/truncate_html_helper.rb

Instance Method Summary collapse

Instance Method Details

#truncate(max_length) ⇒ Object



43
44
45
# File 'app/helpers/postablr/truncate_html_helper.rb', line 43

def truncate(max_length)
  Nokogiri::XML::Text.new(content[0..(max_length - 1)], parent)
end