Class: String

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

Instance Method Summary collapse

Instance Method Details

#limit_length(num) ⇒ Object



102
103
104
105
106
107
108
109
# File 'lib/engine2/core.rb', line 102

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