Methods

Class Index [+]

Quicksearch

When::CalendarTypes::CalendarNotes::Enumerator

イベントを取得する Enumerator

Public Class Methods

new(notes, event, first, direction, count_limit=nil) click to toggle source

オブジェクトの生成

  notes     : When::CalendarTypes::CalendarNotes
    暦注アルゴリズム
  event      : String
    イベント名
  first     : When::TM::(Temporal)Position
    始点
  direction : :forward or :reverse
    :forward - 昇順
    :reverse - 降順
  count_limit : Integer
    繰り返し回数(デフォルトは指定なし)
     # File when/calendartypes.rb, line 841
841:       def initialize(notes, event, first, direction, count_limit=nil)
842:         void, @event, @parameter = event.split(/^([^\d]+)/)
843:         @notes = notes
844:         @delta = @notes.send((@event+'_delta').to_sym, @parameter)
845:         instance_eval %
846:           def event_eval(date)
847:             @notes.#{@event}(date, @parameter)
848:           end
849:         !
850:         date = event_eval(first)
851:         if direction == :forward
852:           date   = event_eval(first + @delta) if first.to_i > date.to_i
853:         else
854:           @delta = -@delta
855:           date   = event_eval(first + @delta) if first.to_i < date.to_i
856:         end
857:         super(date, direction, count_limit)
858:       end

Public Instance Methods

succ() click to toggle source

次のイベントを得る

  returns : When::TM::TemporalPosition
     # File when/calendartypes.rb, line 821
821:       def succ
822:         value    =  @current
823:         @current = (@current==:first) ? @first : event_eval(@current + @delta)
824:         return value
825:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.