Sha256: 830a569f392c5f3caf7b94369e06c76b7a3c6204cdf11f57389c8efa7e419b51

Contents?: true

Size: 888 Bytes

Versions: 13

Compression:

Stored size: 888 Bytes

Contents

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

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

        model Fog::Rackspace::Queues::Claim

        attr_accessor :queue

        def all
          self
        end

        def create(attributes = {})
          object = new(attributes)
          if object.save
            object
          else
            false
          end
        end

        def get(claim_id)
          requires :queue
          data = service.get_claim(queue.identity, claim_id).body
          new(data)
        rescue Fog::Rackspace::Queues::NotFound
          nil
        # HACK - This has been escalated to the Rackspace Queues team, as this 
        # behavior is not normal HTTP behavior.
        rescue Fog::Rackspace::Queues::ServiceError
          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/claims.rb
fog-maestrodev-1.18.0.20131125083406 lib/fog/rackspace/models/queues/claims.rb
fog-maestrodev-1.18.0.20131123105121 lib/fog/rackspace/models/queues/claims.rb
fog-maestrodev-1.18.0.20131122203507 lib/fog/rackspace/models/queues/claims.rb
fog-maestrodev-1.18.0.20131121075022 lib/fog/rackspace/models/queues/claims.rb
fog-maestrodev-1.18.0.20131118164830 lib/fog/rackspace/models/queues/claims.rb
fog-maestrodev-1.18.0.20131115184302 lib/fog/rackspace/models/queues/claims.rb
fog-maestrodev-1.18.0.20131114200144 lib/fog/rackspace/models/queues/claims.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/rackspace/models/queues/claims.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/rackspace/models/queues/claims.rb
fog-1.18.0 lib/fog/rackspace/models/queues/claims.rb
fog-1.17.0 lib/fog/rackspace/models/queues/claims.rb
fog-1.16.0 lib/fog/rackspace/models/queues/claims.rb