Class: CalDAV::Filter::Component

Inherits:
Base
  • Object
show all
Defined in:
lib/caldav/filter.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#child, #parent

Instance Method Summary collapse

Methods inherited from Base

#to_xml

Constructor Details

#initialize(name, parent = nil) ⇒ Component

Returns a new instance of Component.



27
28
29
30
# File 'lib/caldav/filter.rb', line 27

def initialize(name, parent = nil)
  self.name = name
  self.parent = parent
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



25
26
27
# File 'lib/caldav/filter.rb', line 25

def name
  @name
end

Instance Method Details

#build_xml(xml) ⇒ Object



40
41
42
43
44
# File 'lib/caldav/filter.rb', line 40

def build_xml(xml)
  xml.tag! "cal:comp-filter", :name => name do
    child.build_xml(xml) unless child.nil? 
  end
end

#time_range(range) ⇒ Object



32
33
34
# File 'lib/caldav/filter.rb', line 32

def time_range(range)
  self.child = TimeRange.new(range, self)
end

#uid(uid) ⇒ Object



36
37
38
# File 'lib/caldav/filter.rb', line 36

def uid(uid)
  self.child = Property.new("UID", uid, self)
end