Sha256: f85c868eaea34f73113823d35f9be65f733f7ab327670df7d879abe84ab79829

Contents?: true

Size: 1.05 KB

Versions: 6

Compression:

Stored size: 1.05 KB

Contents

module Fog
  module Parsers
    module Compute
      module AWS

        class DescribeReservedInstancesOfferings < Fog::Parsers::Base

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

          def end_element(name)
            case name
            when 'availabilityZone', 'currencyCode', 'instanceType', 'instanceTenancy', 'productDescription', 'reservedInstancesOfferingId'
              @reserved_instances_offering[name] = value
            when 'duration'
              @reserved_instances_offering[name] = value.to_i
            when 'fixedPrice', 'usagePrice'
              @reserved_instances_offering[name] = value.to_f
            when 'item'
              @response['reservedInstancesOfferingsSet'] << @reserved_instances_offering unless @reserved_instances_offering.empty?
              @reserved_instances_offering = {}
            when 'requestId'
              @response[name] = value
            end
          end

        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
fog-parser-fix-1.6.1 lib/fog/aws/parsers/compute/describe_reserved_instances_offerings.rb
fog-test-again-1.6.0 lib/fog/aws/parsers/compute/describe_reserved_instances_offerings.rb
fog-parser-fix-1.6.0 lib/fog/aws/parsers/compute/describe_reserved_instances_offerings.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/aws/parsers/compute/describe_reserved_instances_offerings.rb
fog-1.7.0 lib/fog/aws/parsers/compute/describe_reserved_instances_offerings.rb
fog-1.6.0 lib/fog/aws/parsers/compute/describe_reserved_instances_offerings.rb