Module: Truncato
- Defined in:
- lib/truncato/truncato.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ max_length: 30, count_tags: true, tail: "..." }
Class Method Summary collapse
-
.truncate(source, user_options = {}) ⇒ String
Truncates the source XML string and returns the result.
Class Method Details
.truncate(source, user_options = {}) ⇒ String
Truncates the source XML string and returns the result
16 17 18 19 |
# File 'lib/truncato/truncato.rb', line 16 def self.truncate source, ={} = DEFAULT_OPTIONS.merge() self.truncate_html(source, ) || self.truncate_no_html(source, ) end |