Class: Protocol::Caldav::Ical::Component
- Inherits:
-
Struct
- Object
- Struct
- Protocol::Caldav::Ical::Component
- Defined in:
- lib/protocol/caldav/ical/component.rb
Instance Attribute Summary collapse
-
#components ⇒ Object
Returns the value of attribute components.
-
#name ⇒ Object
Returns the value of attribute name.
-
#properties ⇒ Object
Returns the value of attribute properties.
Instance Method Summary collapse
- #find_all_properties(prop_name) ⇒ Object
- #find_components(comp_name) ⇒ Object
- #find_property(prop_name) ⇒ Object
-
#initialize(name:, properties: [], components: []) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(name:, properties: [], components: []) ⇒ Component
Returns a new instance of Component.
11 12 13 |
# File 'lib/protocol/caldav/ical/component.rb', line 11 def initialize(name:, properties: [], components: []) super(name: name, properties: properties, components: components) end |
Instance Attribute Details
#components ⇒ Object
Returns the value of attribute components
10 11 12 |
# File 'lib/protocol/caldav/ical/component.rb', line 10 def components @components end |
#name ⇒ Object
Returns the value of attribute name
10 11 12 |
# File 'lib/protocol/caldav/ical/component.rb', line 10 def name @name end |
#properties ⇒ Object
Returns the value of attribute properties
10 11 12 |
# File 'lib/protocol/caldav/ical/component.rb', line 10 def properties @properties end |
Instance Method Details
#find_all_properties(prop_name) ⇒ Object
19 20 21 |
# File 'lib/protocol/caldav/ical/component.rb', line 19 def find_all_properties(prop_name) properties.select { |p| p.name.casecmp?(prop_name) } end |
#find_components(comp_name) ⇒ Object
23 24 25 |
# File 'lib/protocol/caldav/ical/component.rb', line 23 def find_components(comp_name) components.select { |c| c.name.casecmp?(comp_name) } end |
#find_property(prop_name) ⇒ Object
15 16 17 |
# File 'lib/protocol/caldav/ical/component.rb', line 15 def find_property(prop_name) properties.find { |p| p.name.casecmp?(prop_name) } end |