Method: Vedeu::Output::Wordwrap#prune

Defined in:
lib/vedeu/output/wordwrap.rb

#pruneArray<String>|String

Returns:

  • (Array<String>|String)


41
42
43
44
45
46
47
48
49
50
51
# File 'lib/vedeu/output/wordwrap.rb', line 41

def prune
  return text if text.size <= pruned_width

  if split_lines.size > 1
    split_lines.reduce([]) { |a, e| a << ellipsis_string(e) }

  else
    ellipsis_string(text)

  end
end