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-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Printing result of class method
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password