Class: Vpim::Icalendar::Vevent::Maker
- Inherits:
-
Object
- Object
- Vpim::Icalendar::Vevent::Maker
- Includes:
- Set::Common, Set::Util
- Defined in:
- lib/vpim/vevent.rb
Overview
Make a new Vevent, or make changes to an existing Vevent.
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
The event that changes are being made to.
Class Method Summary collapse
-
.make(event = Vpim::Icalendar::Vevent.create) {|m| ... } ⇒ Object
Make changes to
event.
Instance Method Summary collapse
-
#dtend(dtend) ⇒ Object
Set end for events with fixed durations.
-
#duration(dur) ⇒ Object
Yields a selector that allows the duration to be set.
-
#initialize(event) ⇒ Maker
constructor
:nodoc:.
-
#transparency(token) ⇒ Object
Set transparency to “OPAQUE” or “TRANSPARENT”, see Vpim::Vevent#transparency.
Methods included from Set::Common
#access_class, #add_attendee, #categories, #comment, #created, #description, #dtstamp, #dtstart, #lastmod, #organizer, #sequence, #summary, #uid, #url
Methods included from Set::Util
#add_address, #field_create, #rm_all, #set_address, #set_date_or_datetime, #set_datetime, #set_integer, #set_text, #set_text_list, #set_token
Constructor Details
#initialize(event) ⇒ Maker
:nodoc:
167 168 169 170 |
# File 'lib/vpim/vevent.rb', line 167 def initialize(event) #:nodoc: @event = event @comp = event end |
Instance Attribute Details
#event ⇒ Object (readonly)
The event that changes are being made to.
165 166 167 |
# File 'lib/vpim/vevent.rb', line 165 def event @event end |
Class Method Details
.make(event = Vpim::Icalendar::Vevent.create) {|m| ... } ⇒ Object
Make changes to event. If event is not specified, creates a new event. Yields a Vevent::Maker, and returns event.
174 175 176 177 178 |
# File 'lib/vpim/vevent.rb', line 174 def self.make(event = Vpim::Icalendar::Vevent.create) #:yield:maker m = self.new(event) yield m m.event end |
Instance Method Details
#dtend(dtend) ⇒ Object
Set end for events with fixed durations. end can be a Date or Time
186 187 188 |
# File 'lib/vpim/vevent.rb', line 186 def dtend(dtend) set_date_or_datetime 'DTEND', 'DATE-TIME', dtend end |
#duration(dur) ⇒ Object
Yields a selector that allows the duration to be set.
TODO - syntax is:
dur-value = (["+"] / "-") "P" (dur-date / dur-time / dur-week)
dur-date = dur-day [ "T" (dur-hour / dur-minute / dur-second) ]
dur-time = "T" (dur-hour / dur-minute / dur-second)
dur-week = 1*DIGIT "W"
197 198 199 |
# File 'lib/vpim/vevent.rb', line 197 def duration(dur) #:yield:selector raise Vpim::Unsupported end |
#transparency(token) ⇒ Object
Set transparency to “OPAQUE” or “TRANSPARENT”, see Vpim::Vevent#transparency.
181 182 183 |
# File 'lib/vpim/vevent.rb', line 181 def transparency(token) set_token 'TRANSP', ["OPAQUE", "TRANSPARENT"], "OPAQUE", token end |