Class: RightAws::Ec2::QEc2DescribeImagesParser

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

Overview


PARSERS: Images

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



1399
1400
1401
# File 'lib/ec2/right_ec2.rb', line 1399

def reset
  @result = []
end

#tagend(name) ⇒ Object



1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
# File 'lib/ec2/right_ec2.rb', line 1384

def tagend(name)
  case name
    when 'imageId'       then @image[:aws_id]       = @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:



1379
1380
1381
1382
1383
# File 'lib/ec2/right_ec2.rb', line 1379

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