Class: Livecal::RecurringEvents

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/livecal/recurring_events.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, from:, to:, changes:) ⇒ RecurringEvents

Returns a new instance of RecurringEvents.



14
15
16
17
18
19
20
21
# File 'lib/livecal/recurring_events.rb', line 14

def initialize(source, from:, to:, changes:)
  @source = source
  @from = from
  @to = to
  @changes = changes.select do |change|
    change.uid == source.uid && change.sequence >= source.sequence
  end
end

Class Method Details

.callObject



10
11
12
# File 'lib/livecal/recurring_events.rb', line 10

def self.call(...)
  new(...).to_a
end

Instance Method Details

#each(&block) ⇒ Object



23
24
25
# File 'lib/livecal/recurring_events.rb', line 23

def each(&block)
  instances.each(&block)
end