Class: Fog::Parsers::Storage::InternetArchive::GetBucketObjectVersions
- Inherits:
-
Base
- Object
- Nokogiri::XML::SAX::Document
- Base
- Fog::Parsers::Storage::InternetArchive::GetBucketObjectVersions
show all
- Defined in:
- lib/fog/internet_archive/parsers/storage/get_bucket_object_versions.rb
Instance Attribute Summary
Attributes inherited from Base
#response
Instance Method Summary
collapse
Methods inherited from Base
#attr_value, #characters, #end_element_namespace, #initialize, #start_element_namespace, #value
Instance Method Details
permalink
#end_element(name) ⇒ Object
[View source]
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# File 'lib/fog/internet_archive/parsers/storage/get_bucket_object_versions.rb', line 28
def end_element(name)
case name
when 'DeleteMarker'
@response['Versions'] << {'DeleteMarker' => @delete_marker }
@delete_marker = { 'Owner' => {} }
@in_delete_marker = false
when 'Version'
@response['Versions'] << {'Version' => @version }
@version = { 'Owner' => {} }
@in_version = false
when 'DisplayName', 'ID'
if @in_delete_marker
@delete_marker
elsif @in_version
@version
end['Owner'][name] = value
when 'ETag'
@version[name] = value.gsub('"', '')
when 'IsLatest'
if @in_delete_marker
@delete_marker
elsif @in_version
@version
end['IsLatest'] = if value == 'true'
true
else
false
end
when 'IsTruncated'
if value == 'true'
@response['IsTruncated'] = true
else
@response['IsTruncated'] = false
end
when 'LastModified'
if @in_delete_marker
@delete_marker
elsif @in_version
@version
end['LastModified'] = Time.parse(value)
when 'MaxKeys'
@response['MaxKeys'] = value.to_i
when 'Size'
@version['Size'] = value.to_i
when 'Key', 'KeyMarker', 'Name', 'NextKeyMarker', 'NextVersionIdMarker', 'Prefix', 'StorageClass', 'VersionId', 'VersionIdMarker'
if @in_delete_marker
@delete_marker
elsif @in_version
@version
else
@response
end[name] = value
end
end
|
[View source]
8
9
10
11
12
13
14
15
16
|
# File 'lib/fog/internet_archive/parsers/storage/get_bucket_object_versions.rb', line 8
def reset
@delete_marker = { 'Owner' => {} }
@version = { 'Owner' => {} }
@in_delete_marke = false
@in_version = false
@response = { 'Versions' => [] }
end
|
permalink
#start_element(name, attrs = []) ⇒ Object
[View source]
18
19
20
21
22
23
24
25
26
|
# File 'lib/fog/internet_archive/parsers/storage/get_bucket_object_versions.rb', line 18
def start_element(name, attrs = [])
super
case name
when 'DeleteMarker'
@in_delete_marker = true
when 'Version'
@in_version = true
end
end
|