# File lib/celerity/element_locator.rb, line 80 def find_by_id(what) case what when Regexp elements_by_tag_names.find { |elem| elem.getId =~ what } when String obj = @object.getElementById(what) return obj if @tags.include?(obj.getTagName) $stderr.puts "warning: multiple elements with identical id? (#{what.inspect})" if $VERBOSE elements_by_tag_names.find { |elem| elem.getId == what } else raise TypeError, "expected String or Regexp, got #{what.inspect}:#{what.class}" end end