Sha256: ea04436502819f03dacf1403062e52a65c5fbfdef8725a63f65c9d271f73bc55

Contents?: true

Size: 586 Bytes

Versions: 32

Compression:

Stored size: 586 Bytes

Contents

module Fog
  module Parsers
    module Compute
      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
end

Version data entries

32 entries across 32 versions & 8 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/compute/get_flavors.rb
michiels-fog-1.3.1 lib/fog/slicehost/parsers/compute/get_flavors.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/slicehost/parsers/compute/get_flavors.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/compute/get_flavors.rb
fog-1.3.1 lib/fog/slicehost/parsers/compute/get_flavors.rb
fog-1.3.0 lib/fog/slicehost/parsers/compute/get_flavors.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/compute/get_flavors.rb
fog-1.2.0 lib/fog/slicehost/parsers/compute/get_flavors.rb
ktheory-fog-1.1.2 lib/fog/slicehost/parsers/compute/get_flavors.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/compute/get_flavors.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/compute/get_flavors.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/compute/get_flavors.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/compute/get_flavors.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/compute/get_flavors.rb
fog-1.1.2 lib/fog/slicehost/parsers/compute/get_flavors.rb
fog_tractical-1.1.4 lib/fog/slicehost/parsers/compute/get_flavors.rb
fog_tractical-1.1.3 lib/fog/slicehost/parsers/compute/get_flavors.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/compute/get_flavors.rb
fog-1.1.1 lib/fog/slicehost/parsers/compute/get_flavors.rb
fog-1.1.0 lib/fog/slicehost/parsers/compute/get_flavors.rb