Class: Vpim::Icalendar::Vtodo::Maker
- Inherits:
-
Object
- Object
- Vpim::Icalendar::Vtodo::Maker
- Includes:
- Set::Common, Set::Location, Set::Util
- Defined in:
- lib/vpim/vtodo.rb
Overview
Make a new Vtodo, or make changes to an existing Vtodo.
Instance Attribute Summary collapse
-
#todo ⇒ Object
readonly
The todo that changes are being made to.
Class Method Summary collapse
-
.make(todo = Vpim::Icalendar::Vtodo.create) {|m| ... } ⇒ Object
Make changes to
todo.
Instance Method Summary collapse
-
#add_rrule(rule = nil, &block) ⇒ Object
Add a RRULE to this todo.
-
#initialize(todo) ⇒ Maker
constructor
:nodoc:.
-
#set_rrule(rule = nil, &block) ⇒ Object
Set the RRULE for this todo.
-
#transparency(token) ⇒ Object
Set transparency to “OPAQUE” or “TRANSPARENT”, see Vpim::Vtodo#transparency.
Methods included from Set::Location
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(todo) ⇒ Maker
:nodoc:
109 110 111 112 |
# File 'lib/vpim/vtodo.rb', line 109 def initialize(todo) #:nodoc: @todo = todo @comp = todo end |
Instance Attribute Details
#todo ⇒ Object (readonly)
The todo that changes are being made to.
107 108 109 |
# File 'lib/vpim/vtodo.rb', line 107 def todo @todo end |
Class Method Details
.make(todo = Vpim::Icalendar::Vtodo.create) {|m| ... } ⇒ Object
Make changes to todo. If todo is not specified, creates a new todo. Yields a Vtodo::Maker, and returns todo.
116 117 118 119 120 |
# File 'lib/vpim/vtodo.rb', line 116 def self.make(todo = Vpim::Icalendar::Vtodo.create) #:yield:maker m = self.new(todo) yield m m.todo end |
Instance Method Details
#add_rrule(rule = nil, &block) ⇒ Object
Add a RRULE to this todo. The rule can be provided as a pre-built RRULE value, or the RRULE maker can be used.
129 130 131 132 133 134 135 136 |
# File 'lib/vpim/vtodo.rb', line 129 def add_rrule(rule = nil, &block) #:yield: Rrule::Maker # TODO - should be in Property::Reccurrence::Set unless rule rule = Rrule::Maker.new(&block).encode end @comp.properties.push(Vpim::DirectoryInfo::Field.create("RRULE", rule)) self end |
#set_rrule(rule = nil, &block) ⇒ Object
Set the RRULE for this todo. See #add_rrule
139 140 141 142 |
# File 'lib/vpim/vtodo.rb', line 139 def set_rrule(rule = nil, &block) #:yield: Rrule::Maker rm_all("RRULE") add_rrule(rule, &block) end |
#transparency(token) ⇒ Object
Set transparency to “OPAQUE” or “TRANSPARENT”, see Vpim::Vtodo#transparency.
123 124 125 |
# File 'lib/vpim/vtodo.rb', line 123 def transparency(token) set_token 'TRANSP', ["OPAQUE", "TRANSPARENT"], "OPAQUE", token end |