# Metho Error

**URL:** <https://www.ruby-forum.com/t/metho-error/123652>\
**Category:** Ruby\
**Created:** [December 19, 2007, 2:55pm UTC](https://www.ruby-forum.com/t/metho-error/123652 "2007-12-19T14:55:23Z")\
**Posts on this page:** 3\
**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 19, 2007, 2:55pm UTC](https://www.ruby-forum.com/t/metho-error/123652/1 "2007-12-19T14:55:23Z")

</div>

Why do I get the folowing error when I run this method ? ?

## wrong number of arguments (2 for 3) (ArgumentError) from C:/Ruby/methodscop/lib/new\_class.rb:65

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 )  
end  
end

---

<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 19, 2007, 3:30pm UTC](https://www.ruby-forum.com/t/metho-error/123652/2 "2007-12-19T15:30:47Z")

</div>

On Dec 19, 7:55 am, Ruby G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Why do I get the folowing error when I run this method ? ?
> 
> wrong number of arguments (2 for 3) (ArgumentError)

Seriously? Well, I’m going to go out on a limb and guess that you only  
passed in two arguments instead of three. Or at least I think that’s  
what “wrong number of arguments (2 for 3)” would mean.

---

<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 19, 2007, 4:45pm UTC](https://www.ruby-forum.com/t/metho-error/123652/3 "2007-12-19T16:45:52Z")

</div>

yermej wrote:

> On Dec 19, 7:55 am, Ruby G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Why do I get the folowing error when I run this method ? ?
> > 
> > wrong number of arguments (2 for 3) (ArgumentError)
> 
> Seriously? Well, I’m going to go out on a limb and guess that you only  
> passed in two arguments instead of three. Or at least I think that’s  
> what “wrong number of arguments (2 for 3)” would mean.

well that’s true I passed only two argument. But my question is How do  
I use that method in order to display this.

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

# will return bsn0 AND bsn1
