Class: Aws::Ec2::QEc2DescribeImageAttributeParser

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

Overview


PARSERS: Image Attribute

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



1896
1897
1898
# File 'lib/ec2/ec2.rb', line 1896

def reset
  @result = {}
end

#tagend(name) ⇒ Object



1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
# File 'lib/ec2/ec2.rb', line 1874

def tagend(name)
  # right now only 'launchPermission' is supported by Amazon.
  # But nobody know what will they xml later as attribute. That is why we
  # check for 'group' and 'userId' inside of 'launchPermission/item'
  case name
    when 'imageId' then
      @result[:aws_id] = @text
    when 'group' then
      @result[:groups] << @text if @xmlpath == 'DescribeImageAttributeResponse/launchPermission/item'
    when 'userId' then
      @result[:users] << @text if @xmlpath == 'DescribeImageAttributeResponse/launchPermission/item'
    when 'productCode' then
      @result[:aws_product_codes] << @text
    when 'kernel' then
      @result[:aws_kernel] = @text
    when 'ramdisk' then
      @result[:aws_ramdisk] = @text
    when 'blockDeviceMapping' then
      @result[:block_device_mapping] = @text
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



1864
1865
1866
1867
1868
1869
1870
1871
1872
# File 'lib/ec2/ec2.rb', line 1864

def tagstart(name, attributes)
  case name
    when 'launchPermission'
      @result[:groups] = []
      @result[:users]  = []
    when 'productCodes'
      @result[:aws_product_codes] = []
  end
end