I have a method that encodes thing depending on what they are - Time,
DateTime, Date, String, etc.
If it’s got a #to_str method, its stringy, that’s easy.
And if it’s got a to_ary method, its arrayie.
But how do I know it’s Time-like? Time and DateTime are both time-like,
for example.
Should I see if it responds to everything I need by manually checking
for year/month/day/hour/min/sec?
Maybe I should just try, and catch method missing, and if I catch that,
try something else?
Or should I do the brute force call to #kind_of? so that it has to be
exactly the classes I know about?
How do other Ruby-ka handle this?
Thanks,
Sam