Skip to content

Conversation

@IvanSelivanov
Copy link

Tod::Shift assumes that its arguments have type Tod::TimeOfDay but it does not really check it. So I guess it's a good idea to either raise an error if arguments have different type, or to try to convert them to correct type.

I chose to convert arguments so one could pass a String or Time to Tod::Shift

@jackc
Copy link
Owner

jackc commented Aug 17, 2019

This is a reasonable change, but it could be done without the ternary test to see if it is already a TimeOfDay. The TimeOfDay function already does that: see https://github.com/jackc/tod/blob/master/lib/tod/conversions.rb#L3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants