Class: Aws::Ec2::QEc2DescribeSnapshotsParser
- Defined in:
- lib/ec2/ec2.rb
Overview
PARSERS: EBS - Snapshots
Constant Summary
Constants inherited from AwsParser
AwsParser::DEFAULT_XML_LIBRARY
Instance Attribute Summary
Attributes inherited from AwsParser
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ QEc2DescribeSnapshotsParser
constructor
:nodoc:.
- #reset ⇒ Object
- #tagend(name) ⇒ Object
- #tagstart(name, attributes) ⇒ Object
Methods inherited from AwsParser
#method_missing, #parse, #tag_end, #tag_start, #tagtext, #text, xml_lib, xml_lib=
Constructor Details
#initialize(params = {}) ⇒ QEc2DescribeSnapshotsParser
:nodoc:
2336 2337 2338 2339 |
# File 'lib/ec2/ec2.rb', line 2336 def initialize (params={}) @inside_tagset = false super(params) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Aws::AwsParser
Instance Method Details
#reset ⇒ Object
2379 2380 2381 |
# File 'lib/ec2/ec2.rb', line 2379 def reset @result = [] end |
#tagend(name) ⇒ Object
2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 |
# File 'lib/ec2/ec2.rb', line 2350 def tagend(name) case name when 'volumeId' then @snapshot[:aws_volume_id] = @text when 'snapshotId' then @snapshot[:aws_id] = @text when 'status' then @snapshot[:aws_status] = @text when 'startTime' then @snapshot[:aws_started_at] = Time.parse(@text) when 'progress' then @snapshot[:aws_progress] = @text when 'description' then @snapshot[:aws_description] = @text when 'ownerId' then @snapshot[:aws_owner] = @text when 'volumeSize' then @snapshot[:aws_volume_size] = @text.to_i when 'tagSet' then @inside_tagset = false when 'key' then @key = ('aws_tag_' + @text).to_sym when 'value' then @snapshot[@key] = @text when 'item' then @result << @snapshot unless @inside_tagset end end |
#tagstart(name, attributes) ⇒ Object
2341 2342 2343 2344 2345 2346 2347 2348 |
# File 'lib/ec2/ec2.rb', line 2341 def (name, attributes) case name when 'tagSet' @inside_tagset = true when 'item' @snapshot = {} unless @inside_tagset end end |