Class: Livecal::RecurringEvents
- Inherits:
-
Object
- Object
- Livecal::RecurringEvents
- Includes:
- Enumerable
- Defined in:
- lib/livecal/recurring_events.rb
Class Method Summary collapse
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(source, from:, to:, changes:) ⇒ RecurringEvents
constructor
A new instance of RecurringEvents.
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
.call ⇒ Object
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 |