Class: Aws::Ec2::QEc2DescribeImagesParser

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

Overview


PARSERS: Images

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



1620
1621
1622
# File 'lib/ec2/ec2.rb', line 1620

def reset
  @result = []
end

#tagend(name) ⇒ Object



1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
# File 'lib/ec2/ec2.rb', line 1589

def tagend(name)
  case name
    when 'imageId' then
      @image[:aws_id] = @text
    when 'name' then
      @image[:aws_name] = @text
    when 'description' then
      @image[:aws_description] = @text
    when 'imageLocation' then
      @image[:aws_location] = @text
    when 'imageState' then
      @image[:aws_state] = @text
    when 'imageOwnerId' then
      @image[:aws_owner] = @text
    when 'isPublic' then
      @image[:aws_is_public]= @text == 'true' ? true : false
    when 'productCode' then
      (@image[:aws_product_codes] ||= []) << @text
    when 'architecture' then
      @image[:aws_architecture] = @text
    when 'imageType' then
      @image[:aws_image_type] = @text
    when 'kernelId' then
      @image[:aws_kernel_id] = @text
    when 'ramdiskId' then
      @image[:aws_ramdisk_id] = @text
    when 'item' then
      @result << @image if @xmlpath[%r{.*/imagesSet$}]
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



1583
1584
1585
1586
1587
# File 'lib/ec2/ec2.rb', line 1583

def tagstart(name, attributes)
  if name == 'item' && @xmlpath[%r{.*/imagesSet$}]
    @image = {}
  end
end