Class: When::V::Event::Enumerator::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/when_exe/icalendar.rb

Overview

多重繰り返しの現在状態

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date) ⇒ Step

Returns a new instance of Step.



1463
1464
1465
1466
# File 'lib/when_exe/icalendar.rb', line 1463

def initialize(date)
  @index = 0
  @date  = date.kind_of?(Array) ? date : [date]
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



1444
1445
1446
# File 'lib/when_exe/icalendar.rb', line 1444

def date
  @date
end

#indexObject (readonly)

Returns the value of attribute index.



1443
1444
1445
# File 'lib/when_exe/icalendar.rb', line 1443

def index
  @index
end

Instance Method Details

#_current_dateObject



1447
1448
1449
# File 'lib/when_exe/icalendar.rb', line 1447

def _current_date
  return @date[@index]
end

#_incObject



1457
1458
1459
1460
# File 'lib/when_exe/icalendar.rb', line 1457

def _inc
  @index += 1
  return self
end

#_previuos_dateObject



1452
1453
1454
# File 'lib/when_exe/icalendar.rb', line 1452

def _previuos_date
  return @date[@index-1]
end