Class: Bureaucrat::Fields::ErrorList
- Inherits:
-
Array
- Object
- Array
- Bureaucrat::Fields::ErrorList
show all
- Includes:
- Utils
- Defined in:
- lib/bureaucrat/fields.rb
Constant Summary
Constants included
from Utils
Utils::ESCAPES
Instance Method Summary
collapse
Methods included from Utils
conditional_escape, escape, flatatt, format_string, make_bool, make_float, mark_safe, pretty_name, security_hash
Instance Method Details
#as_text ⇒ Object
21
22
23
|
# File 'lib/bureaucrat/fields.rb', line 21
def as_text
empty? ? '' : map{|e| '* %s' % e}.join("\n")
end
|
#as_ul ⇒ Object
15
16
17
18
19
|
# File 'lib/bureaucrat/fields.rb', line 15
def as_ul
ul = '<ul class="errorlist">%s</ul>'
li = '<li>%s</li>'
empty? ? '' : mark_safe(ul % map {|e| li % conditional_escape(e)}.join("\n"))
end
|
#to_s ⇒ Object
11
12
13
|
# File 'lib/bureaucrat/fields.rb', line 11
def to_s
as_ul
end
|