Class: RightAws::RdsInterface::DescribeReservedDBInstancesParser

Inherits:
RightAws::RightAWSParser show all
Defined in:
lib/rds/right_rds_interface.rb

Overview

:nodoc:

Constant Summary

Constants inherited from RightAws::RightAWSParser

RightAws::RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAws::RightAWSParser

#full_tag_name, #result, #tag, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from RightAws::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



1584
1585
1586
# File 'lib/rds/right_rds_interface.rb', line 1584

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

#tagend(name) ⇒ Object



1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
# File 'lib/rds/right_rds_interface.rb', line 1593

def tagend(name)
  case name
  when 'Marker'                        then @result[:marker]            = @text
  when 'MaxRecords'                    then @result[:max_records]       = @text.to_i
  when 'DBInstanceClass'               then @item[:instance_class]      = @text
  when 'CurrencyCode'                  then @item[:currency_code]       = @text
  when 'Duration'                      then @item[:duration]            = @text.to_i
  when 'FixedPrice'                    then @item[:fixed_price]         = @text.to_f
  when 'UsagePrice'                    then @item[:usage_price]         = @text.to_f
  when 'MultiAZ'                       then @item[:multi_az]            = (@text == 'true')
  when 'ProductDescription'            then @item[:product_description] = @text
  when 'ReservedDBInstancesOfferingId' then @item[:offering_aws_id]     = @text
  when 'ReservedDBInstanceId'          then @item[:aws_id]              = @text
  when 'State'                         then @item[:state]               = @text
  when 'DBInstanceCount'               then @item[:instance_count]      = @text.to_i
  when 'StartTime'                     then @item[:start_time]          = @text
  when 'OfferingType'                  then @item[:offering_type]       = @text
  when 'RecurringCharge'               then @item[:recurring_charges]  << @recurring_charge
  when 'ReservedDBInstance'            then @result[:reserved_db_instances] << @item
  else
    case full_tag_name
    when %r{RecurringCharge/RecurringChargeAmount$}    then @recurring_charge[:amount]    = @text
    when %r{RecurringCharge/RecurringChargeFrequency$} then @recurring_charge[:frequency] = @text
    end
  end
end

#tagstart(name, attributes) ⇒ Object



1587
1588
1589
1590
1591
1592
# File 'lib/rds/right_rds_interface.rb', line 1587

def tagstart(name, attributes)
  case name
  when 'ReservedDBInstance' then @item = { :recurring_charges => [] }
  when 'RecurringCharge'    then @recurring_charge = {}
  end
end