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



2302
2303
2304
# File 'lib/ec2/ec2.rb', line 2302

def reset
  @result = []
end

#tagend(name) ⇒ Object



2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
# File 'lib/ec2/ec2.rb', line 2266

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



2256
2257
2258
2259
2260
2261
2262
2263
2264
# File 'lib/ec2/ec2.rb', line 2256

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