module VagrantPlugins::OVirtProvider::Util::Collection
Public Class Methods
find_matching(collection, name)
click to toggle source
This method finds a matching thing in a collection of things. This works matching if the ID or NAME equals to ‘name`. Or, if `name` is a regexp, a partial match is chosen as well.
# File lib/vagrant-ovirt4/util/collection.rb, line 9 def self.find_matching(collection, name) collection.each do |single| return single if single.name == name return single if single.id == name end nil end