Sha256: 59cdda43a8cea444e25ba868a877c82a30c0da17064474f5ea2539d084f291ec
Contents?: true
Size: 377 Bytes
Versions: 5
Compression:
Stored size: 377 Bytes
Contents
class TimeFrame # Getting the covering time frame from a bunch of time_frame's. class CoveredFrame def initialize(time_frames) @time_frames = time_frames end def frame return nil unless @time_frames.any? min = @time_frames.min_by(&:min).min max = @time_frames.max_by(&:max).max TimeFrame.new(min: min, max: max) end end end
Version data entries
5 entries across 5 versions & 1 rubygems