Class: Zm::Client::GroupContactJsnsBuilder
Overview
class for account contact jsns builder
Constant Summary
collapse
- EXCLUDE_INSTANCE_VARIABLE_KEYS =
i[@id @name @parent @l @type @tn @jsns_builder].freeze
Instance Method Summary
collapse
#build, #initialize, #to_color, #to_delete, #to_move, #to_rename, #to_tag, #to_trash
Instance Method Details
#instance_variables_array ⇒ Object
46
47
48
|
# File 'lib/zm/client/contact/group_contact_jsns_builder.rb', line 46
def instance_variables_array
[[:nickname, @item.name], [:fullname, @item.name], [:fileAs, "8:#{@item.name}"], i[type group]]
end
|
#members_node ⇒ Object
40
41
42
43
44
|
# File 'lib/zm/client/contact/group_contact_jsns_builder.rb', line 40
def members_node
@item.members.all.reject(&:current?).map do |m|
{ type: m.type, value: m.value, op: m.op }
end
end
|
#to_jsns ⇒ Object
Also known as:
to_create
9
10
11
12
13
14
15
16
17
|
# File 'lib/zm/client/contact/group_contact_jsns_builder.rb', line 9
def to_jsns
{
cn: {
a: instance_variables_array.map(&Utils::A_NODE_PROC),
l: @item.folder_id || Zm::Client::FolderDefault::CONTACTS[:id],
m: members_node
}
}
end
|
#to_patch(hash) ⇒ Object
29
30
31
32
33
34
35
36
|
# File 'lib/zm/client/contact/group_contact_jsns_builder.rb', line 29
def to_patch(hash)
{
cn: {
id: @item.id,
a: hash.map(&Utils::A_ARRAY_PROC).flatten(1).map(&Utils::A_NODE_PROC)
}
}
end
|
#to_update ⇒ Object
19
20
21
22
23
24
25
26
27
|
# File 'lib/zm/client/contact/group_contact_jsns_builder.rb', line 19
def to_update
{
cn: {
a: instance_variables_array.map(&Utils::A_NODE_PROC),
id: @item.id,
m: members_node
}
}
end
|