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
#arrow_name, #clone, #concat, #convert_json_string_value, #initialize, #instance_variables_array, #instance_variables_hash, #recorded?, #save!
Instance Method Details
#end_at ⇒ Object
32
33
34
35
36
|
# File 'lib/zm/client/backup/backup.rb', line 32
def end_at
@end_at ||= Time.at(@end / 1000)
rescue StandardError => e
nil
end
|
#full? ⇒ Boolean
38
39
40
|
# File 'lib/zm/client/backup/backup.rb', line 38
def full?
@type == Zm::Client::BackupTypes::FULL
end
|
#incremental? ⇒ Boolean
42
43
44
|
# File 'lib/zm/client/backup/backup.rb', line 42
def incremental?
@type == Zm::Client::BackupTypes::INCREMENTAL
end
|
#init_from_json(json) ⇒ Object
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/zm/client/backup/backup.rb', line 46
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
26
27
28
29
30
|
# File 'lib/zm/client/backup/backup.rb', line 26
def start_at
@start_at ||= Time.at(@start / 1000)
rescue StandardError => e
nil
end
|
#to_h ⇒ Object
16
17
18
19
20
|
# File 'lib/zm/client/backup/backup.rb', line 16
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
|
#to_s ⇒ Object
22
23
24
|
# File 'lib/zm/client/backup/backup.rb', line 22
def to_s
to_h.to_s
end
|