Class: KnapsackPro::RegularAllocator::Split
- Inherits:
-
Object
- Object
- KnapsackPro::RegularAllocator::Split
- Defined in:
- lib/knapsack_pro/regular_allocator.rb
Instance Method Summary collapse
- #connection_failed? ⇒ Boolean
- #exists? ⇒ Boolean
-
#initialize(connection, response) ⇒ Split
constructor
A new instance of Split.
- #test_files ⇒ Object
Constructor Details
#initialize(connection, response) ⇒ Split
Returns a new instance of Split.
6 7 8 9 10 11 |
# File 'lib/knapsack_pro/regular_allocator.rb', line 6 def initialize(connection, response) @connection = connection @response = response raise ArgumentError.new(connection.response) if connection.errors? end |
Instance Method Details
#connection_failed? ⇒ Boolean
20 21 22 |
# File 'lib/knapsack_pro/regular_allocator.rb', line 20 def connection_failed? !connection.success? end |
#exists? ⇒ Boolean
13 14 15 16 17 18 |
# File 'lib/knapsack_pro/regular_allocator.rb', line 13 def 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::BuildDistributions::TEST_SUITE_SPLIT_CACHE_MISS_CODE true end |
#test_files ⇒ Object
24 25 26 |
# File 'lib/knapsack_pro/regular_allocator.rb', line 24 def test_files response.fetch('test_files') end |