class RedZone::ZoneConfig

Contains zone configurations

Attributes

arpas[R]

Return the list of ArpaNetwork objects @return [Array<ArpaNetwork>] arpa networks

zones[R]

Return the list of Zone objects @return [Array<Zone>] zone

Public Class Methods

new(file) click to toggle source
# File lib/redzone/zone_config.rb, line 13
def initialize(file)
  config = YAML.load_file(file)
  common = config['zones']['common']
  @zones = []
  @arpas = []
  config['zones'].each do |z,c|
    if z != 'common'
      cfg = common.merge(c)
      zone = Zone.new(z,cfg)
      @zones << zone
      @arpas.concat zone.generate_arpa_list()
    end
  end
end