diff --git a/lib/crono/period.rb b/lib/crono/period.rb index 802145e..ffa9b62 100644 --- a/lib/crono/period.rb +++ b/lib/crono/period.rb @@ -78,7 +78,8 @@ module Crono end def time_atts - { hour: @at_hour, min: @at_min }.compact + atts = { hour: @at_hour, min: @at_min } + atts.respond_to?(:compact) ? atts.compact : atts.select { |_, value| !value.nil? } end end end