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

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

Instance Method Summary collapse

Instance Method Details

#end_element(name) ⇒ Object



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

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)


20
21
22
# File 'lib/fog/aws/parsers/redshift/purchase_reserved_node_offering.rb', line 20

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

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



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

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