Sha256: 6f17aebbcf05d219a505110d7fc33c5286415b22d966559ef7ec4637258a2d43

Contents?: true

Size: 1010 Bytes

Versions: 29

Compression:

Stored size: 1010 Bytes

Contents

module Fog
  module Parsers
    module Compute
      module AWS

        class DescribeReservedInstances < Fog::Parsers::Base

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

          def end_element(name)
            case name
            when 'availabilityZone', 'instanceType', 'productDescription', 'reservedInstancesId', 'state'
              @reserved_instance[name] = value
            when 'duration', 'instanceCount'
              @reserved_instance[name] = value.to_i
            when 'fixedPrice', 'usagePrice'
              @reserved_instance[name] = value.to_f
            when 'item'
              @response['reservedInstancesSet'] << @reserved_instance
              @reserved_instance = {}
            when 'requestId'
              @response[name] = value
            when 'start'
              @reserved_instance[name] = Time.parse(value)
            end
          end

        end

      end
    end
  end
end

Version data entries

29 entries across 29 versions & 7 rubygems

Version Path
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/compute/describe_reserved_instances.rb
tag-fog-1.0.1 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/compute/describe_reserved_instances.rb
brightbox-cli-0.14.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-1.0.0 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
brightbox-cli-0.13.1 lib/brightbox-cli/vendor/fog/lib/fog/compute/parsers/aws/describe_reserved_instances.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/compute/parsers/aws/describe_reserved_instances.rb
fog-0.11.0 lib/fog/compute/parsers/aws/describe_reserved_instances.rb
fog-0.10.0 lib/fog/compute/parsers/aws/describe_reserved_instances.rb