Displaying 1 result from an estimated 1 matches for "set_it".
Did you mean:
set_bit
2010 May 17
3
Writing a properly-formed custom type (configxml)
...quot;].attributes
# Split up the comma-separated key-value pairs into an array and then isolate the keys
keys = value(:attributes).split(/,/).map { |s| s.split(/=/)[0] }
# Build up an array of attributes for the specified keys
keys.map { |k| "#{k}=#{attrs[k]}" }
end
def set_it
doc = REXML::Document.new(File.open(value(:name)))
# Take the first element matching the provided XPath expression
attrs = doc.elements[value(:xpath) + "[1]"].attributes
# Split up the list comma-separated key-value pairs and convert the array to hash
updates = Hash[*valu...