[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

mod_ruby and classes

Julien VIVENOT

10/13/2003 4:46:00 PM

Hi,
I ask you for help because I don't understand why mod_ruby say me there's an
error in my script whereas this one works with Ruby itself.

#-------------Script-------------#
class Rbma_query
def initialize(requete)
@requete=requete
@resultat=Array.new
end
def requete
@requete
end
def resultat
@resultat
end
def requete=(str)
@requete=str
end
def escape_pretty_html
#some code
end
def exec
#somme code
end
end

query1=Rbma_query.new
query1.requete="select all from here;"
query1.exec
print query1.escape_pretty_html

#-----------end------------#

in /usr/local/apache2/logs/error_log you can see that mod_ruby say you that
'requete=' is an undefined method !?!?!?!?!?!?!

Thx
Julien Vivenot, a french sixteen-year-old _bad_ developer

(Excuse me for my poor english)

_________________________________________________________________
MSN Search, le moteur de recherche qui pense comme vous !
http://sear...


1 Answer

Simon Strandgaard

10/13/2003 6:31:00 PM

0

On Tue, 14 Oct 2003 02:45:51 +0900, Julien VIVENOT wrote:
[snip]
> class Rbma_query
> def initialize(requete)
> @requete=requete
> @resultat=Array.new
> end
[snip]
> end
>
> query1=Rbma_query.new

What happens if you initialize the Rbma_query class with an argument ?
Perhaps:

query1=Rbma_query.new("test")


> query1.requete="select all from here;"
> query1.exec
> print query1.escape_pretty_html


> in /usr/local/apache2/logs/error_log you can see that mod_ruby say you that
> 'requete=' is an undefined method !?!?!?!?!?!?!

Can you show us some lines from the log file ?



> Julien Vivenot, a french sixteen-year-old _bad_ developer
> (Excuse me for my poor english)

There is nothing wrong with your english.

--
Simon Strandgaard