def rule_time_restriction_to_icecube_schedule(tr, timezone, opts = {})
        return if tr.nil? || !tr.is_a?(Hash) ||
                  timezone.nil? || !timezone.is_a?(ActiveSupport::TimeZone)
        prepared_restrictions = rule_prepare_time_restriction(tr, timezone)
        return if prepared_restrictions.nil?
        IceCube::Schedule.from_hash(prepared_restrictions)
      rescue ArgumentError => ae
        if logger = opts[:logger]
          logger.error "Couldn't parse rule data #{e.class}: #{e.message}"
          logger.error prepared_restrictions.inspect
          logger.error e.backtrace.join("\n")
        end
        nil
      end
NB: ice_cube doesn't have much rule data validation, and has
problems with infinite loops if the data can't logically match; see
https://github.com/seejohnrun/ice_cube/issues/127 &
https://github.com/seejohnrun/ice_cube/issues/137
We may want to consider some sort of timeout-based check around
anything that could fall into that.

We don't want to replicate IceCube's from_hash behaviour here,
but we do need to apply some sanity checking on the passed data.