Sha256: 7313ebe3d398c41482619897be417689ec76e46180b91adcfc547879d726cb3e

Contents?: true

Size: 781 Bytes

Versions: 13

Compression:

Stored size: 781 Bytes

Contents

require 'fog/core/collection'
require 'fog/rackspace/models/queues/queue'

module Fog
  module Rackspace
    class Queues
      class Queues < Fog::Collection

        model Fog::Rackspace::Queues::Queue

        def all
          response = service.list_queues
          if service.list_queues.status == 204
            data = []
          else
            data = service.list_queues.body['queues']
          end
          load(data)
        end

        def get(queue_name)
          #204 no content is returned on success.  That's why no data is passed 
          # from the GET to the constructor.
          service.get_queue(queue_name)
          new({:name => queue_name})
        rescue Fog::Rackspace::Queues::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
fog-maestrodev-1.18.0.20131125111730 lib/fog/rackspace/models/queues/queues.rb
fog-maestrodev-1.18.0.20131125083406 lib/fog/rackspace/models/queues/queues.rb
fog-maestrodev-1.18.0.20131123105121 lib/fog/rackspace/models/queues/queues.rb
fog-maestrodev-1.18.0.20131122203507 lib/fog/rackspace/models/queues/queues.rb
fog-maestrodev-1.18.0.20131121075022 lib/fog/rackspace/models/queues/queues.rb
fog-maestrodev-1.18.0.20131118164830 lib/fog/rackspace/models/queues/queues.rb
fog-maestrodev-1.18.0.20131115184302 lib/fog/rackspace/models/queues/queues.rb
fog-maestrodev-1.18.0.20131114200144 lib/fog/rackspace/models/queues/queues.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/rackspace/models/queues/queues.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/rackspace/models/queues/queues.rb
fog-1.18.0 lib/fog/rackspace/models/queues/queues.rb
fog-1.17.0 lib/fog/rackspace/models/queues/queues.rb
fog-1.16.0 lib/fog/rackspace/models/queues/queues.rb