Module: Flatito::Utils
- Included in:
- Base, FlattenYaml
- Defined in:
- lib/flatito/utils.rb
Instance Method Summary collapse
Instance Method Details
#truncate(string, max = 50) ⇒ Object
5 6 7 |
# File 'lib/flatito/utils.rb', line 5 def truncate(string, max = 50) string.length > max ? "#{string[0...max]}..." : string end |