Printing result of class method

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

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 }

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs