Module: Ree::Contracts::Truncatable

Instance Method Summary collapse

Instance Method Details

#truncate(str, limit = 80) ⇒ Object



5
6
7
# File 'lib/ree/contracts/truncatable.rb', line 5

def truncate(str, limit = 80)
  str.length > limit ? "#{str[0..limit]}..." : str
end