Sha256: f9f44c20199fd685fec0344016df03980eb28e21284cdb1a81b9b1dde0900fe8

Contents?: true

Size: 736 Bytes

Versions: 111

Compression:

Stored size: 736 Bytes

Contents

module Fog
  module Parsers
    module Slicehost

      class GetSlices < Fog::Parsers::Base

        def reset
          @slice = {}
          @response = { 'slices' => [] }
        end

        def end_element(name)
          case name
          when 'address'
            @slice['addresses'] ||= []
            @slice['addresses'] << @value
          when 'backup-id', 'flavor-id', 'id', 'image-id', 'progress'
            @slice[name] = @value.to_i
          when 'bw-in', 'bw-out'
            @slice[name] = @value.to_f
          when 'name', 'status'
            @slice[name] = @value
          when 'slice'
            @response['slices'] << @slice
            @slice = {}
          end
        end

      end

    end
  end
end

Version data entries

111 entries across 111 versions & 2 rubygems

Version Path
fog-0.2.10 lib/fog/slicehost/parsers/get_slices.rb
fog-0.2.9 lib/fog/slicehost/parsers/get_slices.rb
fog-0.2.8 lib/fog/slicehost/parsers/get_slices.rb
fog-0.2.7 lib/fog/slicehost/parsers/get_slices.rb
fog-0.2.6 lib/fog/slicehost/parsers/get_slices.rb
fog-0.2.5 lib/fog/slicehost/parsers/get_slices.rb
fog-0.2.4 lib/fog/slicehost/parsers/get_slices.rb
fog-0.2.3 lib/fog/slicehost/parsers/get_slices.rb
fog-0.2.2 lib/fog/slicehost/parsers/get_slices.rb
fog-0.2.1 lib/fog/slicehost/parsers/get_slices.rb
fog-0.2.0 lib/fog/slicehost/parsers/get_slices.rb
fog-0.1.10 lib/fog/slicehost/parsers/get_slices.rb
fog-0.1.9 lib/fog/slicehost/parsers/get_slices.rb
fog-0.1.8 lib/fog/slicehost/parsers/get_slices.rb
fog-0.1.7 lib/fog/slicehost/parsers/get_slices.rb
fog-0.1.6 lib/fog/slicehost/parsers/get_slices.rb
fog-0.1.5 lib/fog/slicehost/parsers/get_slices.rb
fog-0.1.4 lib/fog/slicehost/parsers/get_slices.rb
fog-0.1.3 lib/fog/slicehost/parsers/get_slices.rb
fog-0.1.2 lib/fog/slicehost/parsers/get_slices.rb