class Console::Event::Spawn
def to_hash
Convert the spawn event to a hash suitable for JSON serialization.
def to_hash Hash.new.tap do |hash| hash[:type] = :spawn hash[:environment] = @environment if @environment&.any? hash[:arguments] = @arguments if @arguments&.any? hash[:options] = @options if @options&.any? hash[:status] = @status.to_i if @status if duration = self.duration hash[:duration] = duration end end end