Class: Markdo::IcsExporter::Event
- Inherits:
-
Object
- Object
- Markdo::IcsExporter::Event
- Defined in:
- lib/markdo/ics_exporter.rb
Instance Method Summary collapse
-
#initialize(date_start, date_end, summary) ⇒ Event
constructor
A new instance of Event.
- #to_ics ⇒ Object
Constructor Details
#initialize(date_start, date_end, summary) ⇒ Event
Returns a new instance of Event.
48 49 50 51 52 |
# File 'lib/markdo/ics_exporter.rb', line 48 def initialize(date_start, date_end, summary) @date_start = date_start @date_end = date_end @summary = summary end |
Instance Method Details
#to_ics ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/markdo/ics_exporter.rb', line 54 def to_ics buf = [] buf << 'BEGIN:VEVENT' buf << "DTSTART;VALUE=DATE:#{@date_start.strftime('%Y%m%d')}" buf << "DTEND;VALUE=DATE:#{@date_end.strftime('%Y%m%d')}" buf << "SUMMARY:#{@summary}" buf << 'END:VEVENT' buf.join("\n") end |