Class: Zm::Client::Tag

Inherits:
Base::AccountObject show all
Includes:
Model::AttributeChangeObserver
Defined in:
lib/zm/client/tag/tag.rb

Overview

class account tag

Constant Summary collapse

INSTANCE_VARIABLE_KEYS =
%i[id name color rgb]

Instance Attribute Summary collapse

Attributes inherited from Base::Object

#grantee_type, #name, #parent, #token

Instance Method Summary collapse

Methods included from Model::AttributeChangeObserver

included

Methods inherited from Base::AccountObject

#concat, #init_from_json, #soap_account_connector, #to_h

Methods inherited from Base::Object

#arrow_name, #clone, #concat, #convert_json_string_value, #disable_builder, #enable_builder, #init_from_json, #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 Attribute Details

#idObject

Returns the value of attribute id.



11
12
13
# File 'lib/zm/client/tag/tag.rb', line 11

def id
  @id
end

Instance Method Details

#all_instance_variable_keysObject



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

def all_instance_variable_keys
  INSTANCE_VARIABLE_KEYS
end

#create!Object



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

def create!
  rep = @parent.sacc.create_tag(@parent.token, jsns_builder.to_jsns)
  json = rep[:Body][:CreateTagResponse][:tag].first
  TagJsnsInitializer.update(self, json)
  super
end

#delete!Object



35
36
37
38
# File 'lib/zm/client/tag/tag.rb', line 35

def delete!
  @parent.sacc.tag_action(@parent.token, jsns_builder.to_delete)
  super
end

#modify!Object



26
27
28
29
# File 'lib/zm/client/tag/tag.rb', line 26

def modify!
  @parent.sacc.tag_action(@parent.token, jsns_builder.to_update) if color_changed? || rgb_changed?
  super
end

#rename!Object



40
41
42
43
# File 'lib/zm/client/tag/tag.rb', line 40

def rename!
  @parent.sacc.tag_action(@parent.token, jsns_builder.to_rename) if name_changed?
  super
end

#update!(hash) ⇒ Object



31
32
33
# File 'lib/zm/client/tag/tag.rb', line 31

def update!(hash)
  # todo
end