Class Index [+]

Quicksearch

Ferret::Browser::ViewHelper

Public Instance Methods

tick_or_cross(t) click to toggle source
    # File lib/ferret/browser.rb, line 79
79:     def tick_or_cross(t)
80:       "<img src=\"/s/i/#{t ? 'tick' : 'cross'}.png\" alt=\"#{t ? 'yes' : 'no'}\"/>"
81:     end
truncate(str, len = 80) click to toggle source

truncates the string at the first space after len characters

    # File lib/ferret/browser.rb, line 72
72:     def truncate(str, len = 80)
73:       if str and str.length > len and (add = str[len..1].index(' '))
74:         str = str[0, len + add] + '&#8230;'
75:       end
76:       str
77:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.