Skip to content

Commit

Permalink
reverted multi_property rendering, changed alarm attach to multi_line…
Browse files Browse the repository at this point in the history
…, updated README
  • Loading branch information
Mark Yoon committed Aug 1, 2008
1 parent 249f600 commit 56059f8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 43 deletions.
72 changes: 31 additions & 41 deletions README
Expand Up @@ -84,61 +84,51 @@ Now for some examples:
# ...other event properties
alarm do
action "EMAIL"
description "This is an event reminder"
summary "Alarm notification"
attendees %w(mailto:me@my-domain.com mailto:me-too@my-domain.com)
description "This is an event reminder" # email body (required)
summary "Alarm notification" # email subject (required)
attendees %w(mailto:me@my-domain.com mailto:me-too@my-domain.com) # one or more email recipients (required)
add_attendee "mailto:me-three@my-domain.com"
remove_attendee "mailto:me@my-domain.com"
trigger "-PT15M" # 15 minutes before
add_attach "ftp://host.com/novo-procs/felizano.exe", {"FMTTYPE" => "application/binary"} # email attachments (optional)
end
end

## and it will output

# BEGIN:VALARM
# ACTION:EMAIL
# TRIGGER:-PT15M
# SUMMARY:Alarm notification
# DESCRIPTION:This is an event reminder
# ATTENDEE:mailto:me-too@my-domain.com
# ATTENDEE:mailto:me-three@my-domain.com
# END:VALARM

## or you popup/display notification alarms like this...
cal.event do
# ...other event properties

alarm do
action "DISPLAY" # This line isn't necessary, it's the default
summary "Alarm notification"
trigger "-P1DT0H0M0S" # 1 day before
end
end

## and it will output

# BEGIN:VALARM
# ACTION:DISPLAY
# TRIGGER:-P1DT0H0M0S
# SUMMARY:Alarm notification
# END:VALARM

## or an audio alarms like this...
cal.event do
# ...other event properties
alarm do
action "AUDIO"
trigger "-PT15M"
add_attach "Basso", {"VALUE" => ["URI"]}
action "AUDIO"
trigger "-PT15M"
add_attach "Basso", {"VALUE" => ["URI"]} # only one attach allowed (optional)
end
end

## and it wiqll output

# BEGIN:VALARM
# ACTION:AUDIO
# ATTACH;VALUE=URI:Basso
# TRIGGER:-PT15M
# END:VALARM
# Output

# BEGIN:VALARM
# ACTION:EMAIL
# ATTACH;FMTTYPE=application/binary:ftp://host.com/novo-procs/felizano.exe
# TRIGGER:-PT15M
# SUMMARY:Alarm notification
# DESCRIPTION:This is an event reminder
# ATTENDEE:mailto:me-too@my-domain.com
# ATTENDEE:mailto:me-three@my-domain.com
# END:VALARM
#
# BEGIN:VALARM
# ACTION:DISPLAY
# TRIGGER:-P1DT0H0M0S
# SUMMARY:Alarm notification
# END:VALARM
#
# BEGIN:VALARM
# ACTION:AUDIO
# ATTACH;VALUE=URI:Basso
# TRIGGER:-PT15M
# END:VALARM

## Timezones

Expand Down
2 changes: 1 addition & 1 deletion lib/icalendar/component.rb
Expand Up @@ -137,7 +137,7 @@ def print_properties
end

# Property name
unless multiline_property?(key) or multi_property?(key)
unless multiline_property?(key)
prelude = "#{key.gsub(/_/, '-').upcase}" +

# Possible parameters
Expand Down
2 changes: 1 addition & 1 deletion lib/icalendar/component/alarm.rb
Expand Up @@ -31,7 +31,7 @@ class Alarm < Component

# Multi properties
ical_multiline_property :attendee, :attendee, :attendees
ical_multi_property :attach, :attachment, :attachments
ical_multiline_property :attach, :attachment, :attachments

def initialize()
super("VALARM")
Expand Down

0 comments on commit 56059f8

Please sign in to comment.