Class: String

Inherits:
Object show all
Defined in:
lib/engine2/core.rb

Instance Method Summary collapse

Instance Method Details

#limit_length(num) ⇒ Object



121
122
123
124
125
126
127
128
# File 'lib/engine2/core.rb', line 121

def limit_length num
    s = self.strip
    if s.length > num
        s[0..num] + "..."
    else
        s
    end
end