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



700
701
702
# File 'lib/ec2/right_ec2_instances.rb', line 700

def reset
  @result = nil
end

#tagend(name) ⇒ Object



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

def tagend(name)
  case full_tag_name
  when %r{/instanceType/value$}   then @result = @text
  when %r{/kernel/value$}         then @result = @text
  when %r{/ramdisk/value$}        then @result = @text
  when %r{/userData/value$}       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{/sourceDestCheck/value$}                   then @result = @text == 'true' ? true : false
  when %r{/groupSet/item} # no trailing $
    case name
    when 'groupId'   then @group[:group_id]   = @text
    when 'groupName' then @group[:group_name] = @text
    when 'item'      then @result << @group
    end
  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



663
664
665
666
667
668
669
670
# File 'lib/ec2/right_ec2_instances.rb', line 663

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