Class: Easy::Resources::Redmine::Errors

Inherits:
ActiveResource::Errors
  • Object
show all
Defined in:
lib/easy/resources/redmine/errors.rb

Instance Method Summary collapse

Instance Method Details

#from_xml(xml, save_cache = false) ⇒ Object

Redmine in XML responses specify type=“array” on Errors It cause that ‘Hash.from_xml` already parsed errors as a Array



8
9
10
11
12
13
14
15
# File 'lib/easy/resources/redmine/errors.rb', line 8

def from_xml(xml, save_cache = false)
  array = begin
    Array.wrap(Hash.from_xml(xml)["errors"])
  rescue StandardError
    []
  end
  from_array array, save_cache
end