Class: Aws::Ec2::QEc2DescribeVolumesParser

Inherits:
AwsParser
  • Object
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



2169
2170
2171
# File 'lib/ec2/ec2.rb', line 2169

def reset
  @result = []
end

#tagend(name) ⇒ Object



2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
# File 'lib/ec2/ec2.rb', line 2133

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] = Aws::Utils.blank?(@text) ? 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



2123
2124
2125
2126
2127
2128
2129
2130
2131
# File 'lib/ec2/ec2.rb', line 2123

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