Class: String

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

Instance Method Summary collapse

Instance Method Details

#escape_htmlObject



130
131
132
# File 'lib/engine2/core.rb', line 130

def escape_html
    Rack::Utils.escape_html(self)
end

#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