Class: RightAws::Ec2::QEc2DescribeImageAttributeParser

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

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



958
959
960
# File 'lib/ec2/right_ec2.rb', line 958

def reset
  @result = QEc2DescribeImageAttributeType.new 
end

#tagend(name) ⇒ Object



944
945
946
947
948
949
950
951
952
953
954
955
956
957
# File 'lib/ec2/right_ec2.rb', line 944

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



936
937
938
939
940
941
942
943
# File 'lib/ec2/right_ec2.rb', line 936

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