Sha256: 5ee07ba28d729c5b48cc928bb29c31d90c92626df01d7774c696956dceac621e

Contents?: true

Size: 523 Bytes

Versions: 111

Compression:

Stored size: 523 Bytes

Contents

module Fog
  module Parsers
    module Slicehost

      class GetFlavors < Fog::Parsers::Base

        def reset
          @flavor = {}
          @response = { 'flavors' => [] }
        end

        def end_element(name)
          case name
          when 'flavor'
            @response['flavors'] << @flavor
            @flavor = {}
          when 'id', 'price', 'ram'
            @flavor[name] = @value.to_i
          when 'name'
            @flavor[name] = @value
          end
        end

      end

    end
  end
end

Version data entries

111 entries across 111 versions & 2 rubygems

Version Path
fog-0.0.62 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.61 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.60 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.59 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.58 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.57 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.56 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.55 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.54 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.53 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.52 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.51 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.50 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.49 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.48 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.47 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.46 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.45 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.44 lib/fog/slicehost/parsers/get_flavors.rb
fog-0.0.43 lib/fog/slicehost/parsers/get_flavors.rb