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



886
887
888
# File 'lib/ec2/right_ec2.rb', line 886

def reset
  @result = QEc2DescribeImageAttributeType.new 
end

#tagend(name) ⇒ Object



872
873
874
875
876
877
878
879
880
881
882
883
884
885
# File 'lib/ec2/right_ec2.rb', line 872

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



864
865
866
867
868
869
870
871
# File 'lib/ec2/right_ec2.rb', line 864

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