Class: RecurrenceSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/recurable/recurrence_serializer.rb

Overview

Serializes between RRULE strings and Recurrence objects. A Recurrence fully represents an RRULE — it can be constructed from the string and stored back as one.

Class Method Summary collapse

Class Method Details

.dump(recurrence_instance) ⇒ Object



12
# File 'lib/recurable/recurrence_serializer.rb', line 12

def self.dump(recurrence_instance) = recurrence_instance&.to_rrule

.load(rrule) ⇒ Object



8
9
10
# File 'lib/recurable/recurrence_serializer.rb', line 8

def self.load(rrule)
  Recurrence.from_rrule(rrule) if rrule.present?
end