class TINCheck::XML::REXML::Parser

Private Instance Methods

attribute_hash(element) click to toggle source
# File lib/tincheck/xml/rexml.rb, line 14
def attribute_hash(element)
  element.attributes.each_with_object({}) { |(k, v), h| h[k] = v.to_s }
end
root(xml) click to toggle source
# File lib/tincheck/xml/rexml.rb, line 18
def root(xml)
  ::REXML::Document.new(xml).root
end
value_with!(element) click to toggle source
# File lib/tincheck/xml/rexml.rb, line 22
def value_with!(element)
  children = element.elements.to_a
  return element.text if element.attributes.empty? && children.empty?
  attribute_hash(element).merge(hash_with(*children))
end