Class: Zm::Client::SignatureJsnsBuilder
- Inherits:
-
Object
- Object
- Zm::Client::SignatureJsnsBuilder
- Defined in:
- lib/zm/client/signature/signature_jsns_builder.rb
Overview
class for account signature jsns builder
Instance Method Summary collapse
-
#initialize(signature) ⇒ SignatureJsnsBuilder
constructor
A new instance of SignatureJsnsBuilder.
- #to_delete ⇒ Object
- #to_jsns ⇒ Object
- #to_rename(new_name) ⇒ Object
- #to_update ⇒ Object
Constructor Details
#initialize(signature) ⇒ SignatureJsnsBuilder
Returns a new instance of SignatureJsnsBuilder.
7 8 9 |
# File 'lib/zm/client/signature/signature_jsns_builder.rb', line 7 def initialize(signature) @signature = signature end |
Instance Method Details
#to_delete ⇒ Object
43 44 45 46 47 48 |
# File 'lib/zm/client/signature/signature_jsns_builder.rb', line 43 def to_delete soap_request = SoapElement.account(SoapAccountConstants::DELETE_SIGNATURE_REQUEST) node_signature = SoapElement.create(SoapConstants::SIGNATURE).add_attribute(SoapConstants::ID, @signature.id) soap_request.add_node(node_signature) soap_request end |
#to_jsns ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/zm/client/signature/signature_jsns_builder.rb', line 11 def to_jsns soap_request = SoapElement.account(SoapAccountConstants::CREATE_SIGNATURE_REQUEST) node_signature = SoapElement.create(SoapConstants::SIGNATURE).add_attributes({ name: @signature.name }) soap_request.add_node(node_signature) node_content = SoapElement.create(SoapConstants::CONTENT).add_attribute(SoapConstants::TYPE, @signature.type).add_content(@signature.content) node_signature.add_node(node_content) soap_request end |
#to_rename(new_name) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/zm/client/signature/signature_jsns_builder.rb', line 31 def to_rename(new_name) attrs = { id: @signature.id, name: new_name } soap_request = SoapElement.account(SoapAccountConstants::MODIFY_SIGNATURE_REQUEST) node_signature = SoapElement.create(SoapConstants::SIGNATURE).add_attributes(attrs) soap_request.add_node(node_signature) soap_request end |
#to_update ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/zm/client/signature/signature_jsns_builder.rb', line 21 def to_update soap_request = SoapElement.account(SoapAccountConstants::MODIFY_SIGNATURE_REQUEST) node_signature = SoapElement.create(SoapConstants::SIGNATURE).add_attributes({ name: @signature.name, id: @signature.id }) soap_request.add_node(node_signature) node_content = SoapElement.create(SoapConstants::CONTENT).add_attribute(SoapConstants::TYPE, @signature.type).add_content(@signature.content) node_signature.add_node(node_content) soap_request end |