Class: Aws::Ec2::QEc2DescribeVolumesParser

Inherits:
AwsParser show all
Defined in:
lib/ec2/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



2011
2012
2013
# File 'lib/ec2/ec2.rb', line 2011

def reset
  @result = []
end

#tagend(name) ⇒ Object



1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
# File 'lib/ec2/ec2.rb', line 1975

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



1965
1966
1967
1968
1969
1970
1971
1972
1973
# File 'lib/ec2/ec2.rb', line 1965

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