I just heard of Chronic and wanted to integrate it with Highline so i
could get natural language dates like “yesterday”, “tomorrow” etc.
I find that I get a nil returned if I do:
dob1 = ask("DOB? ", Chronic)
However, if i try this it works:
def self.parse( string )
dob = ask("Date? ", NameClass)
Looking thru source reveals that :
elsif [Date, DateTime].include?(@answer_type) or
Now Chronic is a module not a class. So i guess in this case no part of
the “case” was called.
Now my question is:
Should there be a respond_to in the Highline case, or perhaps a check
for module also ?
Is there anyway i can do this in one line without modifying highline,
and without creating a separate class. Is there some block method or
param i could use to invoke Chronic.parse ?