Class: Icalendar::Calendar
- Defined in:
- lib/icalendar/calendar.rb
Instance Attribute Summary
Attributes inherited from Component
#name, #properties, #property_params
Instance Method Summary collapse
- #event(&block) ⇒ Object
- #freebusy(&block) ⇒ Object
-
#initialize ⇒ Calendar
constructor
A new instance of Calendar.
- #journal(&block) ⇒ Object
- #timezone(&block) ⇒ Object
- #todo(&block) ⇒ Object
Methods inherited from Component
#add_component, #custom_property, #multi_property?, #print_component, #print_parameter, #print_properties, #respond_to?, #to_ical
Constructor Details
#initialize ⇒ Calendar
Returns a new instance of Calendar.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/icalendar/calendar.rb', line 19 def initialize() super("VCALENDAR") @properties = {} @property_params = {} # Set some defaults self.calscale = "GREGORIAN" # Who knows, but this is the only one in the spec. self.prodid = "iCalendar-Ruby" # Current product... Should be overwritten self.version = "2.0" # Version of the specification end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Icalendar::Component
Instance Method Details
#event(&block) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/icalendar/calendar.rb', line 30 def event(&block) e = Event.new self.add_component e e.instance_eval &block if block e end |
#freebusy(&block) ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/icalendar/calendar.rb', line 57 def freebusy(&block) e = Freebusy.new self.add_component e e.instance_eval &block if block e end |
#journal(&block) ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/icalendar/calendar.rb', line 48 def journal(&block) e = Journal.new self.add_component e e.instance_eval &block if block e end |