#ruby-lang - Fri 23 Mar 2007 between 21:19 and 21:32

NY Lost Funds



apeirosok...
I doubt I'll ever understand it :)
tansakuKesV: see this http://pastie.caboo.se/49181 in the Clinic process I can see how each of the messages is handled by clinic in one place
apeiros: what I mean is that I haven't implemented your suggestion yet - I might find if I do that I'll still be able to see a list of how each message is handled by each location on one code page, but I can't work out I will in my head just yet
aperios: I guess the main reason for not pulling the process method into the message is that different messages are handled differently depending on what location they are in
ibroadfoso I've got some dates as strings in %d/%m/%y format; how do I turn them into ruby Date objects?
tansakuanyhow - either which way round I do it, doesn't help me have generic code to raise an exception if a particular location can't handle that kind of message ...
apeirostansaku, so the process is determined by 2 variables: location-class and message-class?
tansakuapeiros: yes
and I have a specification of how messages are handled at each location, so it's easiest to check that it's following the spec if I have it that way
by that way, I mean with a list of how each message is handled in that location
apeirosand sometimes the process can be inherited?
tansakuI guess I can get what I want like this: http://pastie.caboo.se/49181
apeiroswell, that code won't work
tansakuapeiros: well yeah, like we could have sub classes of clinic that inherited the process ...
apeirosNoMethodError or NameError in line 19
because you don't have the message there.
btw, DONT raise Exception. that's usually not a good idea.
raise "string" if you don't have your own exception class.
tansakuapeiros: hmm pastie went funny on me - now I'm here: http://pastie.caboo.se/49190
kesVtansaku: one way is to think of the different messages as methods that a location can respond to, then it just becomes a case of cheking in process if this method responds to a specific method
apeirosand your own exception class should NOT inherit from Exception but from RuntimeError
kesV*the current class responds to a specific method
apeirostansaku, line 19, where does the "message" come from?
tansakuapeiros: use string instead of exception, got it - I used exception because it seemed to fail when I just tried to raise a string ...
apeirosyield it and have it as argument in the do would be one way. but right now it's nonexistant.
deadsoulshow do i escape a string (from within an RHTML) so that it is URL friendly?
oops
wrong channel
tansakuapeiros: line 19 message comes from the super, i.e. from location.process
apeirostansaku, the reason why not to raise Exception is that rescue defaults to StandardError
tansaku, well, that's nice, you know that, ruby doesn't :)
tansakuapeiros: ruby did seem to know it - it ran and worked
or at least it looked like it did - but as I asked a few minutes ago, it seemed odd that I didn't need to specify it direclty
apeirosyou sure you don't have a method named "message" in that class?
tansakuso it should be like this: http://pastie.caboo.se/49190
apeiros+ do |message|, yes
tansaku, http://pastie.caboo.se/49191 - no, ruby doesn't know ;-)
if it works with you then only because you somewhere have a method "message"
tansakuso like this: http://pastie.caboo.se/49190

Page: 4 11 18 25 32 39 46 53 60 67 

IrcArchive

NY Lost Funds