Class: Zm::Client::BaseAccountJsnsBuilder
- Inherits:
-
Object
- Object
- Zm::Client::BaseAccountJsnsBuilder
show all
- Defined in:
- lib/zm/client/base/base_account_jsns_builder.rb
Overview
class for account tag jsns builder
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BaseAccountJsnsBuilder.
7
8
9
|
# File 'lib/zm/client/base/base_account_jsns_builder.rb', line 7
def initialize(item)
@item = item
end
|
Instance Method Details
#to_color ⇒ Object
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/zm/client/base/base_account_jsns_builder.rb', line 67
def to_color
attrs = {
op: :color,
id: @item.id,
rgb: @item.rgb,
color: @item.color
}
build(attrs)
end
|
#to_delete ⇒ Object
46
47
48
49
50
51
52
53
|
# File 'lib/zm/client/base/base_account_jsns_builder.rb', line 46
def to_delete
attrs = {
op: :delete,
id: @item.id
}
build(attrs)
end
|
#to_move(new_folder_id = nil) ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/zm/client/base/base_account_jsns_builder.rb', line 23
def to_move(new_folder_id = nil)
new_folder_id ||= @item.l
attrs = {
op: :move,
id: @item.id,
l: new_folder_id
}
build(attrs)
end
|
#to_patch(hash) ⇒ Object
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/zm/client/base/base_account_jsns_builder.rb', line 35
def to_patch(hash)
attrs = {
op: :update,
id: @item.id
}.merge(hash)
attrs.reject! { |_, v| v.nil? }
build(attrs)
end
|
#to_rename(new_name = nil) ⇒ Object
55
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/zm/client/base/base_account_jsns_builder.rb', line 55
def to_rename(new_name = nil)
new_name ||= @item.name
attrs = {
op: :rename,
id: @item.id,
name: new_name
}
build(attrs)
end
|
#to_tag(tag_name = nil) ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/zm/client/base/base_account_jsns_builder.rb', line 11
def to_tag(tag_name = nil)
tag_name ||= @item.tn
attrs = {
op: :tag,
id: @item.id,
tn: tag_name
}
build(attrs)
end
|
#to_trash ⇒ Object
81
82
83
84
85
86
87
88
|
# File 'lib/zm/client/base/base_account_jsns_builder.rb', line 81
def to_trash
attrs = {
op: :trash,
id: @item.id
}
build(attrs)
end
|