Class: Fog::Parsers::Redshift::AWS::PurchaseReservedNodeOffering

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/aws/parsers/redshift/purchase_reserved_node_offering.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#attr_value, #characters, #end_element_namespace, #initialize, #start_element_namespace, #value

Constructor Details

This class inherits a constructor from Fog::Parsers::Base

Instance Method Details

#end_element(name) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/fog/aws/parsers/redshift/purchase_reserved_node_offering.rb', line 34

def end_element(name)    
  super        
  case name
  when 'ReservedNodeId', 'ReservedNodeOfferingId', 'NodeType', 'CurrencyCode', 'State', 'OfferingType'
    @response[name] = value
  when 'Duration', 'NodeCount'
    @response[name] = value.to_i
  when 'FixedPrice', 'UsagePrice'
    @response[name] = value.to_f
  when 'StartTime'
    @response[name] = Time.parse(value)
  when 'RecurringChargeAmount'
    @recurring_charge[name] = value.to_f
  when 'RecurringChargeFrequency'
    @recurring_charge[name] = value
  when 'RecurringCharge'
    @response['RecurringCharges'] << {name => @recurring_charge}
    @recurring_charge = {}
  end
end

#resetObject

:reserved_node_id - (String) :reserved_node_offering_id - (String) :node_type - (String) :start_time - (Time) :duration - (Integer) :fixed_price - (Numeric) :usage_price - (Numeric) :currency_code - (String) :node_count - (Integer) :state - (String) :offering_type - (String) :recurring_charges - (Array)

:recurring_charge_amount - (Numeric)
:recurring_charge_frequency - (String)


22
23
24
# File 'lib/fog/aws/parsers/redshift/purchase_reserved_node_offering.rb', line 22

def reset
  @response = { 'RecurringCharges' => [] }
end

#start_element(name, attrs = []) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/aws/parsers/redshift/purchase_reserved_node_offering.rb', line 26

def start_element(name, attrs = [])
  super
  case name
  when 'RecurringCharges'
    @recurring_charge = {}
  end
end