Class: RightAws::Ec2::QEc2DescribeVolumesParser

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

Overview

:nodoc:

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



398
399
400
# File 'lib/ec2/right_ec2_ebs.rb', line 398

def reset
  @result = []
end

#tagend(name) ⇒ Object



373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/ec2/right_ec2_ebs.rb', line 373

def tagend(name)
  case name
  when 'volumeId'
    case @xmlpath
    when 'DescribeVolumesResponse/volumeSet/item' then @volume[:aws_id] = @text
    end
  when 'status'
    case @xmlpath
    when 'DescribeVolumesResponse/volumeSet/item' then @volume[:aws_status] = @text
    when 'DescribeVolumesResponse/volumeSet/item/attachmentSet/item' then @volume[:aws_attachment_status] = @text
    end
  when 'size'             then @volume[:aws_size]        = @text.to_i
  when 'createTime'       then @volume[:aws_created_at]  = @text
  when 'instanceId'       then @volume[:aws_instance_id] = @text
  when 'device'           then @volume[:aws_device]      = @text
  when 'attachTime'       then @volume[:aws_attached_at] = @text
  when 'snapshotId'       then @volume[:snapshot_id]     = @text.blank? ? nil : @text
  when 'availabilityZone' then @volume[:zone]            = @text
  when 'deleteOnTermination' then @volume[:delete_on_termination] = (@text == 'true')
  when 'item'
    case @xmlpath
    when 'DescribeVolumesResponse/volumeSet' then @result << @volume
    end
  end
end

#tagstart(name, attributes) ⇒ Object



365
366
367
368
369
370
371
372
# File 'lib/ec2/right_ec2_ebs.rb', line 365

def tagstart(name, attributes)
  case name
  when 'item'
    case @xmlpath
    when 'DescribeVolumesResponse/volumeSet' then @volume = {}
    end
  end
end