Sha256: 024ed5d3c8976b2909d91c4ce31b74663e0e8a7547b7826f69f2fe58dcca6529

Contents?: true

Size: 811 Bytes

Versions: 8

Compression:

Stored size: 811 Bytes

Contents

module Fog
  module Parsers
    module AWS
      module Compute

        class DescribeSnapshots < Fog::Parsers::Base

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

          def end_element(name)
            case name
            when 'item'
              @response['snapshotSet'] << @snapshot
              @snapshot = {}
            when 'description', 'ownerId', 'progress', 'snapshotId', 'status', 'volumeId'
              @snapshot[name] = @value
            when 'requestId'
              @response[name] = @value
            when 'startTime'
              @snapshot[name] = Time.parse(@value)
            when 'volumeSize'
              @snapshot[name] = @value.to_i
            end
          end

        end

      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fog-0.3.7 lib/fog/aws/parsers/compute/describe_snapshots.rb
fog-0.3.6 lib/fog/aws/parsers/compute/describe_snapshots.rb
fog-0.3.5 lib/fog/aws/parsers/compute/describe_snapshots.rb
fog-0.3.4 lib/fog/aws/parsers/compute/describe_snapshots.rb
fog-0.3.3 lib/fog/aws/parsers/compute/describe_snapshots.rb
fog-0.3.2 lib/fog/aws/parsers/compute/describe_snapshots.rb
fog-0.3.1 lib/fog/aws/parsers/compute/describe_snapshots.rb
fog-0.3.0 lib/fog/aws/parsers/compute/describe_snapshots.rb