Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== RI_CAL -- a new implementation of RFC2445 in Ruby
== RI_CAL -- a new implementation of RFC2445 in Ruby with Outlook FREE / BUSY status implementation
http://ri-cal.rubyforge.org/

by Rick DeNatale
Expand All @@ -17,6 +17,8 @@ A Google group for discussion of this library has been set up http://groups.goog

* All examples of recurring events in RFC 2445 are handled. RSpec examples are provided for them.

Added functionality to support Outlook FREE / BUSY status implementation

== SYNOPSIS:

For the full RDOC see http://ri-cal.rubyforge.org/rdoc/
Expand All @@ -36,6 +38,8 @@ The methods for accessing the properties of each type of component are defined i
same name as the component class in the RiCal::properties module. For example the property
accessing methods for RiCal::Component::Event are defined in RiCal::Properties::Event

Added functionality to support Outlook FREE / BUSY status implementation

=== Creating Calendars and Calendar Components

RiCal provides a builder DSL for creating calendars and calendar components. An example
Expand All @@ -47,6 +51,8 @@ RiCal provides a builder DSL for creating calendars and calendar components. An
dtend DateTime.parse("2/20/1962 19:43:02")
location "Cape Canaveral"
add_attendee "john.glenn@nasa.gov"
#Outlook FREE / BUSY status
outlook_busystatus "FREE"
alarm do
description "Segment 51"
end
Expand All @@ -69,6 +75,7 @@ will be passed as that argument
event.dtend = DateTime.parse("2/20/1962 19:43:02")
event.location = "Cape Canaveral"
event.add_attendee "john.glenn@nasa.gov"
event.outlook_busystatus = "FREE"
event.alarm do
description "Segment 51"
end
Expand Down Expand Up @@ -290,6 +297,7 @@ In either case the result will be an array of components.
CREATED:20090225T000839Z
DTEND;TZID=US/Eastern:20090224T100000
RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20090228T045959Z
X-MICROSOFT-CDO-BUSYSTATUS:FREE
END:VEVENT
END:VCALENDAR
ENDCAL
Expand Down
35 changes: 34 additions & 1 deletion lib/ri_cal/properties/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,36 @@ def request_status_property_from_string(line) # :nodoc:
request_status_property << RiCal::PropertyValue::Text.new(self, line)
end

# return the the X-MICROSOFT-CDO-BUSYSTATUS property
# which will be an instance of RiCal::PropertyValueText
#

def outlook_busystatus_property
@outlook_busystatus_property ||= []
end

# set the the X-MICROSOFT-CDO-BUSYSTATUS property
# one or more instances of RiCal::PropertyValueText may be passed to this method
def outlook_busystatus_property=(property_values)
@outlook_busystatus_property = property_values
end

# set the value of the X-MICROSOFT-CDO-BUSYSTATUS property to a single value
# one instance of String may be passed to this method
def outlook_busystatus=(ruby_value)
@outlook_busystatus_property = RiCal::PropertyValue::Text.convert(self, ruby_value)
end

# return the value of the X-MICROSOFT-CDO-BUSYSTATUS property
# which will be an array of instances of String
def outlook_busystatus
outlook_busystatus ? outlook_busystatus.ruby_value : nil
end

def outlook_busystatus_property_from_string(line) # :nodoc:
outlook_busystatus_property << RiCal::PropertyValue::Text.new(self, line)
end

# return the the RELATED-TO property
# which will be an array of instances of RiCal::PropertyValueText
#
Expand Down Expand Up @@ -1421,6 +1451,7 @@ def export_properties_to(export_stream) #:nodoc:
export_prop_to(export_stream, "LOCATION", @location_property)
export_prop_to(export_stream, "COMMENT", @comment_property)
export_prop_to(export_stream, "SEQUENCE", @sequence_property)
export_prop_to(export_stream, "X-MICROSOFT-CDO-BUSYSTATUS", @outlook_busystatus_property)
end

def ==(o) #:nodoc:
Expand Down Expand Up @@ -1455,7 +1486,8 @@ def ==(o) #:nodoc:
(exrule_property == o.exrule_property) &&
(location_property == o.location_property) &&
(comment_property == o.comment_property) &&
(sequence_property == o.sequence_property)
(sequence_property == o.sequence_property) &&
(outlook_busystatus_property == o.outlook_busystatus_property)
else
super
end
Expand Down Expand Up @@ -1494,6 +1526,7 @@ def initialize_copy(o) #:nodoc:
location_property = location_property && location_property.dup
comment_property = comment_property && comment_property.dup
sequence_property = sequence_property && sequence_property.dup
outlook_busystatus_property = outlook_busystatus_property && outlook_busystatus_property.dup
end

def add_date_times_to(required_timezones) #:nodoc:
Expand Down