Metho Error

R

Ruby Geo

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
 
Y

yermej

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.
 
R

Ruby Geo

yermej said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top