Class: RightAws::Ec2::QEc2DescribeRouteTablesParser

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

Overview


Routes


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



374
375
376
# File 'lib/ec2/right_ec2_vpc2.rb', line 374

def reset
  @result = []
end

#tagend(name) ⇒ Object



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# File 'lib/ec2/right_ec2_vpc2.rb', line 350

def tagend(name)
  case full_tag_name
  # item
  when %r{/(routeTableSet/item|routeTable)/routeTableId$} then @item[:route_table_id] = @text
  when %r{/(routeTableSet/item|routeTable)/vpcId$}        then @item[:vpc_id]         = @text
  when %r{/(routeTableSet/item|routeTable)$}              then @result               << @item
  # route set
  when %r{/routeSet/item/destinationCidrBlock$} then @route_set[:destination_cidr_block] = @text
  when %r{/routeSet/item/gatewayId$}            then @route_set[:gateway_id]             = @text
  when %r{/routeSet/item/instanceId$}           then @route_set[:instance_id]            = @text
  when %r{/routeSet/item/state$}                then @route_set[:state]                  = @text
  when %r{/routeSet/item$}                      then @item[:route_set]                  << @route_set
  # association set
  when %r{/associationSet/item/routeTableId$}            then @association_set[:route_table_id]             = @text
  when %r{/associationSet/item/routeTableAssociationId$} then @association_set[:route_table_association_id] = @text
  when %r{/associationSet/item/subnetId$}                then @association_set[:subnet_id]                  = @text
  when %r{/associationSet/item/main}                     then @association_set[:main]                       = @text == 'true'
  when %r{/associationSet/item$}                         then @item[:association_set]                      << @association_set
  # tags
  when %r{/tagSet/item/key$}   then @aws_tag[:key]               = @text
  when %r{/tagSet/item/value$} then @aws_tag[:value]             = @text
  when %r{/tagSet/item$}       then @item[:tags][@aws_tag[:key]] = @aws_tag[:value]
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



340
341
342
343
344
345
346
347
348
349
# File 'lib/ec2/right_ec2_vpc2.rb', line 340

def tagstart(name, attributes)
  case full_tag_name
  when %r{/(routeTableSet/item|routeTable)$}
    @item = { :route_set       => [],
              :association_set => [],
              :tags            => {}}
  when %r{/routeSet/item$}       then @route_set       = {}
  when %r{/associationSet/item$} then @association_set = {}
  end
end