require "conference_tracker/event" require "conference_tracker/session" module ConferenceTracker class Track attr_accessor :name attr_reader :morning, :afternoon def initialize(morning = Session.morning, afternoon = Session.afternoon, event = Event) @morning = morning @afternoon = afternoon @event = event end def add(talk) @morning.add(talk) || @afternoon.add(talk) self end def empty? @morning.empty? end def schedule [].tap do |s| s << @name s.concat(@morning.schedule) s << @event.lunch.to_s s.concat(@afternoon.schedule) s << @event.networking.update(@afternoon.next_start).to_s end.compact end end end