require 'set' module SublabCalendar class EventList attr_reader :events def initialize(events=[]) @events = SortedSet.new(events) end def to_json(*args) events.map(&:to_json) end end end