On 14 Dec 2011, at 15:14, Pieter Hugo <[email protected]> wrote:

> Hi Colin
> 
> Thanks for bearing with me. Your thinking is spot on in agreement with
> how I understand ruby. And yet
> 
>> class PokeMailer < ActionMailer::Base
>> def receive(email)
>> ...
>> end
>> 
>> I then invoke the receipt of email with
>> 
>> task = PokeMailer.receive(m.pop)
> 
> works 100%
> 
> I tried creating an instance of PokeMailer (see first post)
> 
> pm = PokeMailer.new(userid)
> 
> But it just returns nil, and pm.receive says nil doesn't have a receive
> method.
> 
> I think its something to do with Actionmailer - but it definitely doesnt
> behave like a normal class.

There's a method_missing handler which handles calls to class methods that 
aren't there by creating new instances and dispatching the method to the newly 
created instance

Fred
> 
> :(
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to