# Printing result of class method

**URL:** <https://www.ruby-forum.com/t/printing-result-of-class-method/123177>\
**Category:** Ruby\
**Created:** [December 14, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/printing-result-of-class-method/123177 "2007-12-14T17:56:51Z")\
**Posts on this page:** 2\
**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 14, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/printing-result-of-class-method/123177/1 "2007-12-14T17:56:51Z")

</div>

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

---

<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 14, 2007, 6:41pm UTC](https://www.ruby-forum.com/t/printing-result-of-class-method/123177/2 "2007-12-14T18:41:11Z")

</div>

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 }
