Class: RightAws::Ec2::QEc2DescribeImageAttributeParser

Inherits:
RightAWSParser show all
Defined in:
lib/ec2/right_ec2.rb

Overview

:nodoc:

Constant Summary

Constants inherited from RightAWSParser

RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAWSParser

#result, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from RightAWSParser

#initialize, #method_missing, #parse, #tag_end, #tag_start, #tagtext, #text, xml_lib, xml_lib=

Constructor Details

This class inherits a constructor from RightAws::RightAWSParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightAws::RightAWSParser

Instance Method Details

#resetObject



989
990
991
# File 'lib/ec2/right_ec2.rb', line 989

def reset
  @result = QEc2DescribeImageAttributeType.new 
end

#tagend(name) ⇒ Object



975
976
977
978
979
980
981
982
983
984
985
986
987
988
# File 'lib/ec2/right_ec2.rb', line 975

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' ; @result.imageId = @text
    when 'group'   
      @result.launchPermission.groups  << @text if @xmlpath == 'DescribeImageAttributeResponse/launchPermission/item'
    when 'userId'  
      @result.launchPermission.userIds << @text if @xmlpath == 'DescribeImageAttributeResponse/launchPermission/item'
    when 'productCode'
      (@result.productCodes ||= []) << @text
  end
end

#tagstart(name, attributes) ⇒ Object



967
968
969
970
971
972
973
974
# File 'lib/ec2/right_ec2.rb', line 967

def tagstart(name, attributes)
  case name
    when 'launchPermission'
      @result.launchPermission = QEc2LaunchPermissionItemType.new
      @result.launchPermission.groups  = []
      @result.launchPermission.userIds = []
  end
end