K
KUSUNOSE Toru
Hi,
Sometimes, the latter is better.
For example, think Tempfile class. An instance of Tempfile
class responds to every methods an instace of the File class has,
so surely its type is File. But tmpfile.is_a? File is false.
That is, StrongTyping does not work well with the Delegator
pattern.
In message said:If I wanted a relevant subset of String, would that be better (i.e.
safer/faster) represented by a class/module representing that subset or
just one or a combination of respond_to?. I would argue most of the
time, that it is the former.
Sometimes, the latter is better.
For example, think Tempfile class. An instance of Tempfile
class responds to every methods an instace of the File class has,
so surely its type is File. But tmpfile.is_a? File is false.
That is, StrongTyping does not work well with the Delegator
pattern.