Class: RightAws::AsInterface::DescribeLaunchConfigurationsParser

Inherits:
RightAWSParser
  • Object
show all
Defined in:
lib/as/right_as_interface.rb

Overview


PARSERS: Launch Configurations

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



646
647
648
# File 'lib/as/right_as_interface.rb', line 646

def reset
  @result = { :launch_configurations => []}
end

#tagend(name) ⇒ Object



619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# File 'lib/as/right_as_interface.rb', line 619

def tagend(name)
  case name
  when 'CreatedTime'             then @item[:created_time]              = @text
  when 'InstanceType'            then @item[:instance_type]             = @text
  when 'KeyName'                 then @item[:key_name]                  = @text
  when 'ImageId'                 then @item[:image_id]                  = @text
  when 'KernelId'                then @item[:kernel_id]                 = @text
  when 'RamdiskId'               then @item[:ramdisk_id]                = @text
  when 'LaunchConfigurationName' then @item[:launch_configuration_name] = @text
  when 'UserData'                then @item[:user_data]                 = @text
  when 'NextToken'               then @result[:next_token]              = @text
  else
    case full_tag_name
    when %r{/BlockDeviceMappings/member} # no trailing $
      case name
      when 'DeviceName'          then @block_device_mapping[:device_name]  = @text
      when 'VirtualName'         then @block_device_mapping[:virtual_name] = @text
      when 'member'              then @item[:block_device_mappings]        << @block_device_mapping
      end
    when %r{member/SecurityGroups/member$} 
      @item[:security_groups] << @text
    when %r{/LaunchConfigurations/member$}
      @item[:security_groups].sort!
      @result[:launch_configurations] << @item
    end
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



610
611
612
613
614
615
616
617
618
# File 'lib/as/right_as_interface.rb', line 610

def tagstart(name, attributes)
  case full_tag_name
  when %r{/LaunchConfigurations/member$}
    @item = { :block_device_mappings => [],
              :security_groups       => [] }
  when %r{/BlockDeviceMappings/member$}
    @block_device_mapping = {}
  end
end