Class: Aws::Ec2::QEc2DescribeVolumesParser

Inherits:
AwsParser show all
Defined in:
lib/ec2/right_ec2.rb

Overview

:nodoc:

Constant Summary

Constants inherited from AwsParser

AwsParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from AwsParser

#result, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from AwsParser

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

Constructor Details

This class inherits a constructor from Aws::AwsParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Aws::AwsParser

Instance Method Details

#resetObject



1815
1816
1817
# File 'lib/ec2/right_ec2.rb', line 1815

def reset
  @result = []
end

#tagend(name) ⇒ Object



1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
# File 'lib/ec2/right_ec2.rb', line 1791

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]  = Time.parse(@text)
    when 'instanceId'       then @volume[:aws_instance_id] = @text
    when 'device'           then @volume[:aws_device]      = @text
    when 'attachTime'       then @volume[:aws_attached_at] = Time.parse(@text)
    when 'snapshotId'       then @volume[:snapshot_id]     = @text.blank? ? nil : @text
    when 'availabilityZone' then @volume[:zone]            = @text
    when 'item'
      case @xmlpath
      when 'DescribeVolumesResponse/volumeSet' then @result << @volume
      end
  end
end

#tagstart(name, attributes) ⇒ Object



1783
1784
1785
1786
1787
1788
1789
1790
# File 'lib/ec2/right_ec2.rb', line 1783

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