Class: Zm::Client::Cos
- Inherits:
-
Base::AdminObject
- Object
- Base::Object
- Base::AdminObject
- Zm::Client::Cos
- Defined in:
- lib/zm/client/cos/cos.rb
Overview
objectClass: zimbraCos
Instance Attribute Summary
Attributes inherited from Base::Object
#grantee_type, #id, #name, #parent, #token
Instance Method Summary collapse
- #accounts ⇒ Object
-
#all_instance_variable_keys ⇒ Object
def to_h hashmap = Hash[all_instance_variable_keys.map { |key| [key, instance_variable_get(arrow_name(key))] }] hashmap.delete_if { |_, v| v.nil? } hashmap end.
- #create! ⇒ Object
- #delete! ⇒ Object
- #duplicate(attrs = {}) ⇒ Object
- #init_from_json(json) ⇒ Object
-
#initialize(parent) ⇒ Cos
constructor
A new instance of Cos.
- #modify! ⇒ Object
- #servers ⇒ Object
Methods inherited from Base::AdminObject
#soap_account_connector, #soap_admin_connector, #to_h
Methods inherited from Base::Object
#arrow_name, #clone, #concat, #convert_json_string_value, #disable_builder, #enable_builder, #instance_variables_array, #instance_variables_hash, #logger, #recorded?, #save!, #to_s, #use_builder?
Constructor Details
#initialize(parent) ⇒ Cos
Returns a new instance of Cos.
8 9 10 11 |
# File 'lib/zm/client/cos/cos.rb', line 8 def initialize(parent) extend(CosCommon) super(parent) end |
Instance Method Details
#accounts ⇒ Object
54 55 56 |
# File 'lib/zm/client/cos/cos.rb', line 54 def accounts # TODO: sélectionner tous les comptes qui ont zimbraCOSID=self.id end |
#all_instance_variable_keys ⇒ Object
def to_h
hashmap = Hash[all_instance_variable_keys.map { |key| [key, instance_variable_get(arrow_name(key))] }]
hashmap.delete_if { |_, v| v.nil? }
hashmap
end
25 26 27 |
# File 'lib/zm/client/cos/cos.rb', line 25 def all_instance_variable_keys attrs_write end |
#create! ⇒ Object
45 46 47 48 |
# File 'lib/zm/client/cos/cos.rb', line 45 def create! rep = sac.create_cos(name, instance_variables_array(attrs_write)) @id = rep[:Body][:CreateCosResponse][:cos].first[:id] end |
#delete! ⇒ Object
41 42 43 |
# File 'lib/zm/client/cos/cos.rb', line 41 def delete! sac.delete_cos(id) end |
#duplicate(attrs = {}) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/zm/client/cos/cos.rb', line 29 def duplicate(attrs = {}) # n = clone # attrs.each{|k,v| n.instance_variable_set(k, v) } # n.id = nil # n.zimbraId = nil # n end |
#init_from_json(json) ⇒ Object
13 14 15 16 17 |
# File 'lib/zm/client/cos/cos.rb', line 13 def init_from_json(json) super(json) @zimbraMailHostPool = [@zimbraMailHostPool] if @zimbraMailHostPool.is_a?(String) @zimbraZimletAvailableZimlets = [@zimbraZimletAvailableZimlets] if @zimbraZimletAvailableZimlets.is_a?(String) end |
#modify! ⇒ Object
37 38 39 |
# File 'lib/zm/client/cos/cos.rb', line 37 def modify! sac.modify_cos(id, instance_variables_array(attrs_write)) end |
#servers ⇒ Object
50 51 52 |
# File 'lib/zm/client/cos/cos.rb', line 50 def servers @servers ||= read_servers end |