Class: Icalendar::Event

Inherits:
Component show all
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

Attributes inherited from Component

#name, #properties

Instance Method Summary collapse

Methods inherited from Component

#add_component, #custom_property, #multi_property?, #multiline_property?, #new_uid, #print_component, #print_parameters, #print_properties, #remove_component, #respond_to?, #to_ical

Methods inherited from Base

debug, quiet

Constructor Details

#initializeEvent

Returns a new instance of Event.



103
104
105
106
107
108
109
110
# File 'lib/icalendar/component/event.rb', line 103

def initialize()
  super("VEVENT")

  # Now doing some basic initialization
  sequence 0
  timestamp DateTime.now
  uid new_uid
end

Dynamic Method Handling

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

Instance Method Details

#alarm(&block) ⇒ Object



112
113
114
115
116
117
118
119
# File 'lib/icalendar/component/event.rb', line 112

def alarm(&block)
  a = Alarm.new
  self.add a

  a.instance_eval &block if block

  a
end