= Conference.new("RubyConf 2020") # conf.talks << talk1 # conf.talks << talk2 # class Conference # The name of the conference. attr_reader name: String # Talks of the conference. attr_reader talks: Array[Talk] def initialize: (String name) -> void # Yields all speakers of the conference. # Deduped, and no order guaranteed. def each_speaker: { (Speaker) -> void } -> void | () -> Enumerator[Speaker, void] end conference = Conference.new("RubyConf 2020") talks = [...] conference.talks.push(*talks) conference.each_speaker do |speaker| puts "%s (%s)" % [speaker.name, speaker.email] end