Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine-cli/resources.rb

Overview

HACK: Redmine API isn’t ActiveResource-friendly out of the box, and also some versions of Redmine ignore the nometa=1 parameter. So we need to manually strip out metadata that confuses ActiveResource.

Class Method Summary collapse

Class Method Details

.from_xml(xml) ⇒ Object



56
57
58
59
# File 'lib/redmine-cli/resources.rb', line 56

def from_xml(xml)
  scrubbed = scrub_attributes(xml)
  from_xml_original(scrubbed)
end

.from_xml_originalObject



55
# File 'lib/redmine-cli/resources.rb', line 55

alias_method :from_xml_original, :from_xml

.scrub_attributes(xml) ⇒ Object



60
61
62
# File 'lib/redmine-cli/resources.rb', line 60

def scrub_attributes(xml)
  xml.gsub(/<issues .*?>/, "<issues type=\"array\">")
end