Partial Search

Can someone please help me to adjust the folowing method into
displaying
using a flag. Basically what I want it to do it have an array of
keywords
and a flag which asks partial match or exact

These are the keywords.

KEYWORDS =[“Sole Trader”, “Retail”, “Builder”, “Internet” ]

And this is the current method.

def self.search_by_keyword(businesses, searched_keyword)
businesses.select do |b|
b.my_keywords.include?(searched_keyword)
end
end

It has to me something like this.

  def self.search_by_keyword(businesses, searched_keyword_as_array,

flag_exact_or_partial_match)
businesses.select do |b|
b.my_keywords.include?(searched_keyword)
end
en