Class: Protocol::Caldav::Ical::Component

Inherits:
Struct
  • Object
show all
Defined in:
lib/protocol/caldav/ical/component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, properties: [], components: []) ⇒ Component

Returns a new instance of Component.



14
15
16
# File 'lib/protocol/caldav/ical/component.rb', line 14

def initialize(name:, properties: [], components: [])
  super(name: name, properties: properties, components: components)
end

Instance Attribute Details

#componentsObject

Returns the value of attribute components

Returns:

  • (Object)

    the current value of components



8
9
10
# File 'lib/protocol/caldav/ical/component.rb', line 8

def components
  @components
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



8
9
10
# File 'lib/protocol/caldav/ical/component.rb', line 8

def name
  @name
end

#propertiesObject

Returns the value of attribute properties

Returns:

  • (Object)

    the current value of properties



8
9
10
# File 'lib/protocol/caldav/ical/component.rb', line 8

def properties
  @properties
end

Instance Method Details

#find_all_properties(prop_name) ⇒ Object



22
23
24
# File 'lib/protocol/caldav/ical/component.rb', line 22

def find_all_properties(prop_name)
  properties.select { |p| p.name.casecmp?(prop_name) }
end

#find_components(comp_name) ⇒ Object



26
27
28
# File 'lib/protocol/caldav/ical/component.rb', line 26

def find_components(comp_name)
  components.select { |c| c.name.casecmp?(comp_name) }
end

#find_property(prop_name) ⇒ Object



18
19
20
# File 'lib/protocol/caldav/ical/component.rb', line 18

def find_property(prop_name)
  properties.find { |p| p.name.casecmp?(prop_name) }
end