alpinweis / cronex

Ruby library that converts cron expressions into human readable strings
Other
78 stars 29 forks source link

Suggestion: Move locale and timezone into options #17

Closed DannyBen closed 4 years ago

DannyBen commented 4 years ago

It would be nicer if all options - including locale and timezone - are treated the same.

The fact that there is an empty hash in the below call, is not very "ruby":

Cronex::ExpressionDescriptor.new('* * * * *", {}, "fr").description

The problem is even more evident when you want to only set timezone

Cronex::ExpressionDescriptor.new('* * * * *", {}, nil, "New York").description

Would be clearer and nicer (and dare I say idiomatic....) to do:

Cronex::ExpressionDescriptor.new('* * * * *", locale: 'fr', timezone: "New York").description
alpinweis commented 4 years ago

👍

alpinweis commented 4 years ago

18 is addressing this issue