Printing result of class method

R

Ruby Geo

class Business

def some_method
end

def some_other

end

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

end


Can you please tell me what to do to print on the screen the result of
this method.


businesses = [bsn0, bsn1, bsn2, bsn3, bsn4]
Business.search_by_keyword(businesses, KEYWORDS[2])


Dont know what how to print out can you help pls.

Thank You
 
R

Ruby Geo

Thanx PPL for Replying me. Buy I did it, on my own way.

class Business

def some_method
end

def some_other

end

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

end


Business.search_by_keyword([bsn0, bsn1, bsn2, bsn3, bsn4],
KEYWORDS[3]).each{|r| puts r }
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top