lib/dor/workflow/response/workflow.rb in dor-workflow-client-3.24.0 vs lib/dor/workflow/response/workflow.rb in dor-workflow-client-4.0.0
- old
+ new
@@ -33,10 +33,10 @@
# Returns the process, for the most recent version that matches the given name:
def process_for_recent_version(name:)
nodes = process_nodes_for(name: name)
node = nodes.max { |a, b| a.attr('version').to_i <=> b.attr('version').to_i }
- attributes = node ? Hash[node.attributes.collect { |k, v| [k.to_sym, v.value] }] : {}
+ attributes = node ? node.attributes.to_h { |k, v| [k.to_sym, v.value] } : {}
Process.new(parent: self, **attributes)
end
def empty?
ng_xml.xpath('/workflow/process').empty?