class KnapsackPro::QueueAllocator::Batch
Attributes
Public Class Methods
Source
# File lib/knapsack_pro/queue_allocator.rb, line 8 def initialize(connection, response) @connection = connection @response = response raise ArgumentError.new(connection.response) if connection.errors? end
Public Instance Methods
Source
# File lib/knapsack_pro/queue_allocator.rb, line 22 def connection_failed? !connection.success? end
Source
# File lib/knapsack_pro/queue_allocator.rb, line 15 def queue_exists? raise "Connection failed. Please report this as a bug: #{KnapsackPro::Urls::SUPPORT}" if connection_failed? return false if connection.api_code == KnapsackPro::Client::API::V1::Queues::CODE_ATTEMPT_CONNECT_TO_QUEUE_FAILED true end
Source
# File lib/knapsack_pro/queue_allocator.rb, line 26 def test_files response.fetch('test_files') end