code: function(options) {
        this.rule = ICAL.helpers.formatClassType(options.rule, ICAL.Recur);
  
        if (!this.rule) {
          throw new Error('iterator requires a (ICAL.Recur) rule');
        }
  
        this.dtstart = ICAL.helpers.formatClassType(options.dtstart, ICAL.Time);
  
        if (!this.dtstart) {
          throw new Error('iterator requires a (ICAL.Time) dtstart');
        }
  
        if (options.by_data) {
          this.by_data = options.by_data;
        } else {
          this.by_data = ICAL.helpers.clone(this.rule.parts, true);
        }
  
        if (options.occurrence_number)
          this.occurrence_number = options.occurrence_number;
  
        this.days = options.days || [];
        if (options.last) {
          this.last = ICAL.helpers.formatClassType(options.last, ICAL.Time);
        }
  
        this.by_indices = options.by_indices;
  
        if (!this.by_indices) {
          this.by_indices = {
            "BYSECOND": 0,
            "BYMINUTE": 0,
            "BYHOUR": 0,
            "BYDAY": 0,
            "BYMONTH": 0,
            "BYWEEKNO": 0,
            "BYMONTHDAY": 0
          };
        }
  
        this.initialized = options.initialized || false;
  
        if (!this.initialized) {
          this.init();
        }
      }
docs: Initialize the recurrence iterator from the passed data object. This
  method is usually not called directly, you can initialize the iterator
  through the constructor.
  
  @param {Object} options                The iterator options
  @param {ICAL.Recur} options.rule       The rule to iterate.
  @param {ICAL.Time} options.dtstart     The start date of the event.
  @param {Boolean=} options.initialized  When true, assume that options are
  from a previously constructed iterator. Initialization will not be
  repeated.