Class: Bosh::Director::CidrRangeCombiner

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/cidr_range_combiner.rb

Instance Method Summary collapse

Instance Method Details

#combine_ranges(cidr_ranges) ⇒ Object



3
4
5
6
7
8
# File 'lib/bosh/director/cidr_range_combiner.rb', line 3

def combine_ranges(cidr_ranges)
  sorted_cidr_ranges = sort_ranges(cidr_ranges)
  min_max_cidr_tuples = min_max_tuples(sorted_cidr_ranges)
  combined_cidr_tuples = combine_adjacent_ranges(min_max_cidr_tuples)
  stringify_tuples(combined_cidr_tuples)
end