Class: RightAws::Ec2::QEc2DescribeInstanceAttributeParser

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

Overview

:nodoc:

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



697
698
699
# File 'lib/ec2/right_ec2_instances.rb', line 697

def reset
  @result = nil
end

#tagend(name) ⇒ Object



675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
# File 'lib/ec2/right_ec2_instances.rb', line 675

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



669
670
671
672
673
674
# File 'lib/ec2/right_ec2_instances.rb', line 669

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