Sha256: a5f9b30721c64591603caba565783d92c4068cee044fbae359638c1444288349

Contents?: true

Size: 834 Bytes

Versions: 39

Compression:

Stored size: 834 Bytes

Contents

module Fog
  module Parsers
    module Compute
      module AWS
        class DescribeSpotPriceHistory < Fog::Parsers::Base
          def reset
            @spot_price = {}
            @response = { 'spotPriceHistorySet' => [] }
          end

          def end_element(name)
            case name
            when 'availabilityZone', 'instanceType', 'productDescription'
              @spot_price[name] = value
            when 'item'
              @response['spotPriceHistorySet'] << @spot_price
              @spot_price = {}
            when 'requestId', 'nextToken'
              @response[name] = value
            when 'spotPrice'
              @spot_price[name] = value.to_f
            when 'timestamp'
              @spot_price[name] = Time.parse(value)
            end
          end
        end
      end
    end
  end
end

Version data entries

39 entries across 37 versions & 3 rubygems

Version Path
fog-aws-3.1.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-aws-2.0.1/lib/fog/aws/parsers/compute/describe_spot_price_history.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-aws-2.0.1/lib/fog/aws/parsers/compute/describe_spot_price_history.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-aws-2.0.1/lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-3.0.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-2.0.1 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-2.0.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-1.4.1 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-1.4.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-1.3.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-1.2.1 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-1.2.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-1.1.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-1.0.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-0.13.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-0.12.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-0.11.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-0.10.0 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-0.9.4 lib/fog/aws/parsers/compute/describe_spot_price_history.rb
fog-aws-0.9.3 lib/fog/aws/parsers/compute/describe_spot_price_history.rb