Class: Zm::Client::Backup
Constant Summary
collapse
- INSTANCE_VARIABLE_KEYS =
%i[label type aborted start end minRedoSeq maxRedoSeq live accounts]
Instance Attribute Summary
#grantee_type, #id, #parent, #token
Instance Method Summary
collapse
#soap_account_connector, #soap_admin_connector, #to_h
#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 Method Details
#all_instance_variable_keys ⇒ Object
16
17
18
|
# File 'lib/zm/client/backup/backup.rb', line 16
def all_instance_variable_keys
INSTANCE_VARIABLE_KEYS
end
|
#end_at ⇒ Object
36
37
38
39
40
|
# File 'lib/zm/client/backup/backup.rb', line 36
def end_at
@end_at ||= Time.at(@end / 1000)
rescue StandardError => e
nil
end
|
#init_from_json(json) ⇒ Object
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/zm/client/backup/backup.rb', line 50
def init_from_json(json)
@label = json[:label]
@type = json[:type]
@aborted = json[:aborted]
@start = json[:start].to_i
@end = json[:end].to_i
@minRedoSeq = json[:minRedoSeq]
@maxRedoSeq = json[:maxRedoSeq]
@live = json[:live]
@accounts = json[:accounts]
end
|
#server ⇒ Object
12
13
14
|
# File 'lib/zm/client/backup/backup.rb', line 12
def server
parent
end
|
#start_at ⇒ Object
30
31
32
33
34
|
# File 'lib/zm/client/backup/backup.rb', line 30
def start_at
@start_at ||= Time.at(@start / 1000)
rescue StandardError => e
nil
end
|
#to_s ⇒ Object
def to_h
hashmap = Hash[INSTANCE_VARIABLE_KEYS.map { |key| [key, instance_variable_get(arrow_name(key))] }]
hashmap.delete_if { |_, v| v.nil? }
hashmap
end
26
27
28
|
# File 'lib/zm/client/backup/backup.rb', line 26
def to_s
to_h.to_s
end
|