Class: RightAws::Ec2::QEc2DescribeInstanceAttributeParser

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

Overview

:nodoc:

Constant Summary

Constant Summary

Constants inherited from RightAWSParser

RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAWSParser

#full_tag_name, #result, #tag, #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



667
668
669
# File 'lib/ec2/right_ec2_instances.rb', line 667

def reset
  @result = nil
end

#tagend(name) ⇒ Object



645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
# File 'lib/ec2/right_ec2_instances.rb', line 645

def tagend(name)
  case full_tag_name
  when %r{/instanceType/value$}   then @result = @text
  when %r{/kernel$}               then @result = @text
  when %r{/ramdisk$}              then @result = @text
  when %r{/userData$}             then @result = @text
  when %r{/rootDeviceName/value$} then @result = @text
  when %r{/disableApiTermination/value}              then @result = @text == 'true' ? true : false
  when %r{/instanceInitiatedShutdownBehavior/value$} then @result = @text
  when %r{/blockDeviceMapping/item} # no trailing $
    case name
    when 'deviceName'          then @block_device_mapping[:device_name]                = @text
    when 'virtualName'         then @block_device_mapping[:virtual_name]               = @text
    when 'noDevice'            then @block_device_mapping[:no_device]                  = @text
    when 'volumeId'            then @block_device_mapping[:ebs_volume_id]              = @text
    when 'status'              then @block_device_mapping[:ebs_status]                 = @text
    when 'attachTime'          then @block_device_mapping[:ebs_attach_time]            = @text
    when 'deleteOnTermination' then @block_device_mapping[:ebs_delete_on_termination]  = @text == 'true' ? true : false
    when 'item'                then @result                                           << @block_device_mapping
    end
  end
end

#tagstart(name, attributes) ⇒ Object



639
640
641
642
643
644
# File 'lib/ec2/right_ec2_instances.rb', line 639

def tagstart(name, attributes)
  case full_tag_name
  when %r{blockDeviceMapping$}      then @result = []
  when %r{blockDeviceMapping/item$} then @block_device_mapping = {}
  end
end