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



63
64
65
66
# File 'lib/redmine-cli/resources.rb', line 63

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

.from_xml_originalObject



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

alias_method :from_xml_original, :from_xml

.scrub_attributes(xml) ⇒ Object



67
68
69
# File 'lib/redmine-cli/resources.rb', line 67

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