[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Printing result of class method

Ruby Geo

12/14/2007 4:57:00 PM

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

1 Answer

Ruby Geo

12/14/2007 5:41:00 PM

0

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