Class: When::CalendarNote::ShireWeek::Enumerator
- Inherits:
-
Enumerator
- Object
- Enumerator
- Parts::Enumerator
- Enumerator
- When::CalendarNote::ShireWeek::Enumerator
- Defined in:
- lib/when_exe/region/shire.rb
Overview
イベントを取得する Enumerator
Instance Attribute Summary
Attributes inherited from Parts::Enumerator
#count, #count_limit, #current, #direction, #exdate, #first, #index, #last, #object, #options, #parent, #processed
Instance Method Summary collapse
-
#succ ⇒ When::TM::TemporalPosition
次のイベントを得る.
Methods inherited from Enumerator
Methods inherited from Parts::Enumerator
_options, #_rewind, #each, #has_next?, #initialize, #next, #with_index, #with_object
Constructor Details
This class inherits a constructor from When::CalendarNote::Enumerator
Instance Method Details
#succ ⇒ When::TM::TemporalPosition
次のイベントを得る
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/when_exe/region/shire.rb', line 171 def succ value = @current plus = @delta.sign > 0 if @current==:first @first = event_eval(@first) unless plus @current = @first else if plus @current = event_eval(@current + @delta) else @last = event_eval(@current - When.Duration('P1D')) @current = event_eval(@current + @delta) unless [@current.to_i, value.to_i].include?(@last.to_i) @current = @last return value end end @current = event_eval(@current + @delta * 2) if @current.to_i == value.to_i end return value end |