Class: RightAws::RdsInterface::DescribeReservedDBInstancesOfferingsParser

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

Overview


DB Reserved Instances

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

:nodoc:



1550
1551
1552
# File 'lib/rds/right_rds_interface.rb', line 1550

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

#tagend(name) ⇒ Object



1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
# File 'lib/rds/right_rds_interface.rb', line 1559

def tagend(name)
  case name
  when 'Marker'                        then @result[:marker]            = @text
  when 'MaxRecords'                    then @result[:max_records]       = @text.to_i
  when 'CurrencyCode'                  then @item[:currency_code]       = @text
  when 'DBInstanceClass'               then @item[:instance_class]      = @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 'OfferingType'                  then @item[:offering_type]       = @text
  when 'ReservedDBInstancesOfferingId' then @item[:aws_id]              = @text
  when 'RecurringCharge'               then @item[:recurring_charges]  << @recurring_charge
  when 'ReservedDBInstancesOffering'   then @result[:reserved_db_instances_offerings] << @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



1553
1554
1555
1556
1557
1558
# File 'lib/rds/right_rds_interface.rb', line 1553

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