Jay McGavren's Journal

2013-08-13

Here’s the kind of code sample I have to throw away every day because it won’t fit in the available space…

scene = ['bullseye teacup prisoner',
         'ballerina waldo tablecloth',
         'zebra fencepost awning']

result = scene.find do |area|
  area.include?('waldo')
end

puts result # => ballerina waldo tablecloth
comments powered by Disqus