2008/4/12, Joel VanderWerf <vjoel / path.berkeley.edu>:

>  Why do you need a From class that is distinct from Header?

Because in an initial parsing I just get a headers array, whiotu
inspecting each of them.
Later, if I need, I look for some specific headers (From, To...) and
need to add some methods to them.


> Depending on the
> reason, it might work to make From a module:
>
>  module From
>   # special From methods here
>  end
>
>  headers.each do |h|
>   if h.name == "From"
>     h.extend From
>   end
>   # or maybe something like:
>   # h.extend const_get(h.name)
>  end

Thanks, this is great! I didn't know "extend" method.


-- 
Iaki Baz Castillo
<ibc / aliax.net>