[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Partial Search

Ruby Geo

12/17/2007 9:40:00 AM

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
--
Posted via http://www.ruby-....