Class: Zm::Client::Base::AccountObject

Inherits:
Object
  • Object
show all
Defined in:
lib/zm/client/base/account_object.rb

Overview

Abstract Class Provisionning AccountObject

Instance Attribute Summary

Attributes inherited from Object

#grantee_type, #id, #name, #parent, #token

Instance Method Summary collapse

Methods inherited from Object

#arrow_name, #clone, #convert_json_string_value, #disable_builder, #enable_builder, #initialize, #instance_variables_array, #instance_variables_hash, #logger, #recorded?, #save!, #to_s, #use_builder?

Constructor Details

This class inherits a constructor from Zm::Client::Base::Object

Instance Method Details

#concatObject



15
16
17
# File 'lib/zm/client/base/account_object.rb', line 15

def concat
  all_instance_variable_keys.map { |key| instance_variable_get(arrow_name(key)) }
end

#create!Object



32
33
34
# File 'lib/zm/client/base/account_object.rb', line 32

def create!
  @id
end

#delete!Object



45
46
47
# File 'lib/zm/client/base/account_object.rb', line 45

def delete!
  remove_instance_variable(:@id)
end

#init_from_json(json) ⇒ Object



19
20
21
22
23
24
# File 'lib/zm/client/base/account_object.rb', line 19

def init_from_json(json)
  all_instance_variable_keys.each do |key|
    next if json[key].nil?
    instance_variable_set(arrow_name(key), json[key])
  end
end

#modify!Object



36
37
38
39
# File 'lib/zm/client/base/account_object.rb', line 36

def modify!
  rename!
  true
end

#rename!Object



41
42
43
# File 'lib/zm/client/base/account_object.rb', line 41

def rename!
  true
end

#soap_account_connectorObject Also known as: sacc



9
10
11
# File 'lib/zm/client/base/account_object.rb', line 9

def 
  @parent.
end

#to_hObject



26
27
28
29
30
# File 'lib/zm/client/base/account_object.rb', line 26

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