Module: GlobalPhone::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/global_phone/utils.rb

Instance Method Summary collapse

Instance Method Details

#map_detect(collection) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/global_phone/utils.rb', line 5

def map_detect(collection)
  collection.each do |value|
    if result = yield(value)
      return result
    end
  end
  nil
end