Class: RightAws::AsInterface::DescribeAutoScalingGroupsParser

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

Overview


PARSERS: Auto Scaling Groups

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



599
600
601
602
# File 'lib/as/right_as_interface.rb', line 599

def reset
  @p      = 'DescribeAutoScalingGroupsResponse/DescribeAutoScalingGroupsResult/AutoScalingGroups'
  @result = []
end

#tagend(name) ⇒ Object



576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
# File 'lib/as/right_as_interface.rb', line 576

def tagend(name)
  case name
  when 'CreatedTime'             then @item[:created_time]              = @text
  when 'MinSize'                 then @item[:min_size]                  = @text.to_i
  when 'MaxSize'                 then @item[:max_size]                  = @text.to_i
  when 'DesiredCapacity'         then @item[:desired_capacity]          = @text.to_i
  when 'Cooldown'                then @item[:cooldown]                  = @text.to_i
  when 'LaunchConfigurationName' then @item[:launch_configuration_name] = @text
  when 'AutoScalingGroupName'    then @item[:auto_scaling_group_name]   = @text
  when 'InstanceId'              then @instance[:instance_id]       = @text
  when 'LifecycleState'          then @instance[:lifecycle_state]   = @text
  when 'AvailabilityZone'        then @instance[:availability_zone] = @text
  when 'member'
    case @xmlpath
    when @p then
      @item[:availability_zones].sort!
      @result << @item
    when "#@p/member/AvailabilityZones" then @item[:availability_zones] << @text
    when "#@p/member/LoadBalancerNames" then @item[:load_balancer_names] << @text
    when "#@p/member/Instances"         then @item[:instances] << @instance
    end
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



565
566
567
568
569
570
571
572
573
574
575
# File 'lib/as/right_as_interface.rb', line 565

def tagstart(name, attributes)
  case name
  when 'member'
    case @xmlpath
      when @p then @item = { :instances => [ ],
                             :availability_zones => [],
                             :load_balancer_names => [] }
      when "#@p/member/Instances" then @instance = { }
    end
  end
end