Class: RightAws::Ec2::QEc2DescribeSnapshotsParser

Inherits:
RightAWSParser show all
Defined in:
lib/ec2/right_ec2_ebs.rb

Overview


PARSERS: EBS - Snapshots

Constant Summary

Constants inherited from RightAWSParser

RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAWSParser

#full_tag_name, #result, #tag, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from RightAWSParser

#initialize, #method_missing, #parse, #tag_end, #tag_start, #tagtext, #text, xml_lib, xml_lib=

Constructor Details

This class inherits a constructor from RightAws::RightAWSParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightAws::RightAWSParser

Instance Method Details

#resetObject



425
426
427
428
# File 'lib/ec2/right_ec2_ebs.rb', line 425

def reset
  @each = ['item', 'CreateSnapshotResponse']
  @result = []
end

#tagend(name) ⇒ Object



412
413
414
415
416
417
418
419
420
421
422
423
424
# File 'lib/ec2/right_ec2_ebs.rb', line 412

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 *@each        then @result << @snapshot
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



407
408
409
410
411
# File 'lib/ec2/right_ec2_ebs.rb', line 407

def tagstart(name, attributes)
  case name
  when *@each then @snapshot = {}
  end
end