Class: SabredavClient::XmlRequestBuilder::PostSharing
- Defined in:
- lib/sabredav_client/xml_request_builder/post_sharing.rb
Instance Attribute Summary collapse
-
#adds ⇒ Object
Returns the value of attribute adds.
-
#common_name ⇒ Object
Returns the value of attribute common_name.
-
#privilege ⇒ Object
Returns the value of attribute privilege.
-
#removes ⇒ Object
Returns the value of attribute removes.
-
#summary ⇒ Object
Returns the value of attribute summary.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(adds, summary, common_name, privilege, removes) ⇒ PostSharing
constructor
A new instance of PostSharing.
- #to_xml ⇒ Object
Constructor Details
#initialize(adds, summary, common_name, privilege, removes) ⇒ PostSharing
Returns a new instance of PostSharing.
7 8 9 10 11 12 13 14 |
# File 'lib/sabredav_client/xml_request_builder/post_sharing.rb', line 7 def initialize(adds, summary, common_name, privilege, removes) @adds = adds @summary = summary @privilege = privilege @common_name = common_name @removes = removes super() end |
Instance Attribute Details
#adds ⇒ Object
Returns the value of attribute adds.
5 6 7 |
# File 'lib/sabredav_client/xml_request_builder/post_sharing.rb', line 5 def adds @adds end |
#common_name ⇒ Object
Returns the value of attribute common_name.
5 6 7 |
# File 'lib/sabredav_client/xml_request_builder/post_sharing.rb', line 5 def common_name @common_name end |
#privilege ⇒ Object
Returns the value of attribute privilege.
5 6 7 |
# File 'lib/sabredav_client/xml_request_builder/post_sharing.rb', line 5 def privilege @privilege end |
#removes ⇒ Object
Returns the value of attribute removes.
5 6 7 |
# File 'lib/sabredav_client/xml_request_builder/post_sharing.rb', line 5 def removes @removes end |
#summary ⇒ Object
Returns the value of attribute summary.
5 6 7 |
# File 'lib/sabredav_client/xml_request_builder/post_sharing.rb', line 5 def summary @summary end |
Instance Method Details
#to_xml ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/sabredav_client/xml_request_builder/post_sharing.rb', line 16 def to_xml xml.cs :share, CS_NAMESPACES do unless adds.empty? adds.each do |add| add = "mailto:#{add}" xml.cs :set do xml.d :href, add xml.cs :summary, summary unless summary.nil? xml.tag! "cs:common-name", common_name unless common_name.nil? xml.tag! "cs:#{privilege}" end end end unless removes.empty? removes.each do |remove| remove = "mailto:#{remove}" xml.cs :remove do xml.d :href, remove end end end end end |