Class: Fog::Parsers::CDN::AWS::GetStreamingDistributionList
- Inherits:
-
Base
- Object
- Nokogiri::XML::SAX::Document
- Base
- Fog::Parsers::CDN::AWS::GetStreamingDistributionList
show all
- Defined in:
- lib/rackspace-fog/aws/parsers/cdn/get_streaming_distribution_list.rb
Instance Attribute Summary
Attributes inherited from Base
#response
Instance Method Summary
collapse
Methods inherited from Base
#attr_value, #characters, #initialize, #value
Instance Method Details
#end_element(name) ⇒ Object
22
23
24
25
26
27
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
|
# File 'lib/rackspace-fog/aws/parsers/cdn/get_streaming_distribution_list.rb', line 22
def end_element(name)
case name
when 'StreamingDistributionSummary'
@response['StreamingDistributionSummary'] << @distribution_summary
@distribution_summary = { 'CNAME' => [], 'TrustedSigners' => [] }
when 'Comment', 'DomainName', 'Id', 'Status'
@distribution_summary[name] = @value
when 'CNAME'
@distribution_summary[name] << @value
when 'DNSName', 'OriginAccessIdentity'
@distribution_summary[@origin][name] = @value
when 'Enabled'
if @value == 'true'
@distribution_summary[name] = true
else
@distribution_summary[name] = false
end
when 'LastModifiedTime'
@distribution_summary[name] = Time.parse(@value)
when 'IsTruncated'
if @value == 'true'
@response[name] = true
else
@response[name] = false
end
when 'Marker', 'NextMarker'
@response[name] = @value
when 'MaxItems'
@response[name] = @value.to_i
end
end
|
#reset ⇒ Object
8
9
10
11
|
# File 'lib/rackspace-fog/aws/parsers/cdn/get_streaming_distribution_list.rb', line 8
def reset
@distribution_summary = { 'CNAME' => [], 'TrustedSigners' => [] }
@response = { 'StreamingDistributionSummary' => [] }
end
|
#start_element(name, attrs = []) ⇒ Object
13
14
15
16
17
18
19
20
|
# File 'lib/rackspace-fog/aws/parsers/cdn/get_streaming_distribution_list.rb', line 13
def start_element(name, attrs = [])
super
case name
when 'S3Origin'
@origin = name
@distribution_summary[@origin] = {}
end
end
|