Class: Vmpooler::Parsing

Inherits:
Object
  • Object
show all
Defined in:
lib/vmpooler/util/parsing.rb

Class Method Summary collapse

Class Method Details

.get_platform_pool_count(requested, &_block) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/vmpooler/util/parsing.rb', line 6

def self.get_platform_pool_count(requested, &_block)
  requested_platforms = requested.split(',')
  requested_platforms.each do |platform|
    platform_alias, pool, count = platform.split(':')
    raise ArgumentError if platform_alias.nil? || pool.nil? || count.nil?

    yield platform_alias, pool, count
  end
end