exercises/handling-get-requests/app.rb
##
# Case insensitive search. Returns an array of quotes. Allows `terms` to be URI
# Encoded.
#   See: http://ruby-doc.org/stdlib-2.1.2/libdoc/uri/rdoc/URI/Escape.html#method-i-unescape
# Examples:
#   search("Analytical%20Engine") # => [ { :quote => "The Analytical Engine...", ... }, ...]
#   search("Programming") # => [ {:quote => "To me programming...", ... }, ...]
Case insensitive search. Returns an array of quotes. Allows `terms` to be URI
Encoded.
Case insensitive search . Returns an array of quotes . Allows ` terms ` to be URI Encoded .
def search(terms)
  QUOTES.select do |quote|
    quote[:quote].downcase.include?(URI.unescape(terms.downcase))
  end
end
def search ( terms ) QUOTES . select do | quote | quote [ :quote ] . downcase . include? ( URI . unescape ( terms . downcase ) ) end end
Case insensitive search.
Case insensitive search .
terms