Sha256: e790bf55bd0c1be3ba5d1e9a0950b026b0aced32e9b70a08abd4b5c0898ceddf

Contents?: true

Size: 1.02 KB

Versions: 32

Compression:

Stored size: 1.02 KB

Contents

module Fog
  module Parsers
    module AWS
      module Storage

        class ListParts < Fog::Parsers::Base

          def reset
            @part = {}
            @response = { 'Initiator' => {}, 'Part' => [] }
          end

          def end_element(name)
            case name
            when 'Bucket', 'Key', 'NextPartNumberMarker', 'PartNumberMarker', 'StorageClass', 'UploadId'
              @response[name] = @value
            when 'DisplayName', 'ID'
              @response['Initiator'][name] = @value
            when 'ETag'
              @part[name] = @value
            when 'IsTruncated'
              @response[name] = @value == 'true'
            when 'LastModified'
              @part[name] = Time.parse(@value)
            when 'MaxParts'
              @response[name] = @value.to_i
            when 'Part'
              @response['Part'] << @part
              @part = {}
            when 'PartNumber', 'Size'
              @part[name] = @value.to_i
            end
          end

        end

      end
    end
  end
end

Version data entries

32 entries across 32 versions & 3 rubygems

Version Path
fog-0.7.2 lib/fog/storage/parsers/aws/list_parts.rb
fog-0.7.1 lib/fog/storage/parsers/aws/list_parts.rb
fog-0.7.0 lib/fog/storage/parsers/aws/list_parts.rb
fog-0.6.0 lib/fog/storage/parsers/aws/list_parts.rb
fog-0.5.3 lib/fog/storage/parsers/aws/list_parts.rb
fog-0.5.2 lib/fog/storage/parsers/aws/list_parts.rb
fog-0.5.1 lib/fog/storage/parsers/aws/list_parts.rb
fog-0.5.0 lib/fog/storage/parsers/aws/list_parts.rb
phpfog-fog-0.4.1.3 lib/fog/storage/parsers/aws/list_parts.rb
phpfog-fog-0.4.1.2 lib/fog/storage/parsers/aws/list_parts.rb
phpfog-fog-0.4.1.1 lib/fog/storage/parsers/aws/list_parts.rb
phpfog-fog-0.4.1 lib/fog/storage/parsers/aws/list_parts.rb
fog-0.4.1 lib/fog/storage/parsers/aws/list_parts.rb
fog-0.4.0 lib/fog/aws/parsers/storage/list_parts.rb
fog-0.3.34 lib/fog/aws/parsers/storage/list_parts.rb
fog-0.3.33 lib/fog/aws/parsers/storage/list_parts.rb
fog-0.3.32 lib/fog/aws/parsers/storage/list_parts.rb
fog-0.3.31 lib/fog/aws/parsers/storage/list_parts.rb
fog-0.3.30 lib/fog/aws/parsers/storage/list_parts.rb
fog-0.3.29 lib/fog/aws/parsers/storage/list_parts.rb