Class: Zm::Client::MtaQueue
Instance Attribute Summary collapse
-
#n ⇒ Object
(also: #nb_items)
readonly
Returns the value of attribute n.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Base::Object
#grantee_type, #id, #parent, #token
Instance Method Summary
collapse
#soap_account_connector, #soap_admin_connector
#arrow_name, #clone, #concat, #convert_json_string_value, #disable_builder, #enable_builder, #initialize, #instance_variables_array, #instance_variables_hash, #logger, #recorded?, #save!, #use_builder?
Instance Attribute Details
#n ⇒ Object
Also known as:
nb_items
Returns the value of attribute n.
8
9
10
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 8
def n
@n
end
|
#name ⇒ Object
Returns the value of attribute name.
8
9
10
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 8
def name
@name
end
|
Instance Method Details
#all_instance_variable_keys ⇒ Object
26
27
28
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 26
def all_instance_variable_keys
%w[name n]
end
|
#delete!(ids) ⇒ Object
46
47
48
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 46
def delete!(ids)
do_action(Zm::Client::MtaQueueAction::DELETE, ids)
end
|
#do_action(action_name, ids) ⇒ Object
34
35
36
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 34
def do_action(action_name, ids)
sac.mail_queue_action(parent.name, name, action_name, ids)
end
|
#hold!(ids) ⇒ Object
38
39
40
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 38
def hold!(ids)
do_action(Zm::Client::MtaQueueAction::HOLD, ids)
end
|
#init_from_json(json) ⇒ Object
54
55
56
57
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 54
def init_from_json(json)
@name = json[:name]
@n = json[:n].to_i
end
|
#items ⇒ Object
30
31
32
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 30
def items
@items ||= MtaQueueItemsCollection.new self
end
|
#release!(ids) ⇒ Object
42
43
44
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 42
def release!(ids)
do_action(Zm::Client::MtaQueueAction::RELEASE, ids)
end
|
#requeue!(ids) ⇒ Object
50
51
52
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 50
def requeue!(ids)
do_action(Zm::Client::MtaQueueAction::REQUEUE, ids)
end
|
#server ⇒ Object
12
13
14
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 12
def server
parent
end
|
#to_h ⇒ Object
16
17
18
19
20
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 16
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
|
#to_s ⇒ Object
22
23
24
|
# File 'lib/zm/client/mta_queue/mta_queue.rb', line 22
def to_s
to_h.to_s
end
|