Class: Icalendar::Event

Inherits:
Component show all
Includes:
Dtstart
Defined in:
lib/icalendar/component/event.rb

Overview

A Event calendar component is a grouping of component properties, and possibly including Alarm calendar components, that represents a scheduled amount of time on a calendar. For example, it can be an activity; such as a one-hour long, department meeting from 8:00 AM to 9:00 AM, tomorrow. Generally, an event will take up time on an individual calendar.

Instance Attribute Summary collapse

Attributes inherited from Component

#name, #properties, #property_params

Instance Method Summary collapse

Methods included from Dtstart

#getStart, #setStart

Methods inherited from Component

#method_missing, #print_string

Constructor Details

#initializeEvent

Returns a new instance of Event.



13
14
15
16
17
# File 'lib/icalendar/component/event.rb', line 13

def initialize()
  super("VEVENT")
  
  @alarms = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Icalendar::Component

Instance Attribute Details

#alarmsObject

Returns the value of attribute alarms.



11
12
13
# File 'lib/icalendar/component/event.rb', line 11

def alarms
  @alarms
end

Instance Method Details

#to_sObject



19
20
21
22
23
# File 'lib/icalendar/component/event.rb', line 19

def to_s
  print_string do |s| 
    @alarms.each { |alarm| s << alarm.to_s } 
  end
end