Class: DataMapper::Validate::ValidationErrors
- Inherits:
-
Object
- Object
- DataMapper::Validate::ValidationErrors
- Defined in:
- lib/ruboss4ruby/datamapper_foo.rb
Instance Method Summary collapse
Instance Method Details
#to_xml ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ruboss4ruby/datamapper_foo.rb', line 7 def to_xml xml = Builder::XmlMarkup.new(:indent => 2) xml.instruct! :xml, :version => "1.0", :encoding => "UTF-8" xml.errors do |e| @errors.each_key do |attribute| @errors[attribute].each do |msg| next if msg.nil? if attribute == "base" e.error("message" => msg) else e.error("field" => attribute.to_s.camelcase(:lower), "message" => msg) end end end end end |