Sha256: bb9ab6fac1521f6c8bdb6a69206a77db1b27b9189eff4d8a13d08d58127ea9c5

Contents?: true

Size: 811 Bytes

Versions: 50

Compression:

Stored size: 811 Bytes

Contents

module Fog
  module Parsers
    module Slicehost
      module Compute

        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
end

Version data entries

50 entries across 50 versions & 3 rubygems

Version Path
fog-0.3.28 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.27 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.26 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.25 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.24 lib/fog/slicehost/parsers/compute/get_slices.rb
bbcloud-0.8.1 lib/bbcloud/vendor/fog-0.3.23/lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.23 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.22 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.21 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.20 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.19 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.18 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.17 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.16 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.15 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.14 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.13 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.12 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.11 lib/fog/slicehost/parsers/compute/get_slices.rb
fog-0.3.10 lib/fog/slicehost/parsers/compute/get_slices.rb