# Checking results

**URL:** <https://www.ruby-forum.com/t/checking-results/123759>\
**Category:** Ruby\
**Created:** [December 20, 2007, 11:58am UTC](https://www.ruby-forum.com/t/checking-results/123759 "2007-12-20T11:58:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruby\_tl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c0e974/32.png) [@ruby\_tl](https://www.ruby-forum.com/u/ruby_tl)\
**Post date:** [December 20, 2007, 11:58am UTC](https://www.ruby-forum.com/t/checking-results/123759/1 "2007-12-20T11:58:17Z")

</div>

Hi

## I am having difficulty in passing the folowing class method, that takes three argument. Basically I need the method to display the right data after doing all the check ups. This is the method.

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\_as\_array).true  
b.my\_keywords.include?(searched\_keyword\_as\_array )  
#flag\_exact\_or\_partial\_match = true  
end  
end

The object created from the class.  
=---------------------------------------------  
bsn1 = Business.new(“Steve”, “02089293323”, "22 lilly Road ")  
bsn1.add\_keyword(KEYWORDS[0])  
bsn1.add\_keyword(KEYWORDS[2])

## Method call

Business.search\_by\_keyword([bsn0, bsn1, bsn2], [KEYWORDS[0],KEYWORDS[2]  
],false) # true here mean ‘partial match’

# will return bsn0 AND bsn1
