Class: RedZone::ZoneConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/redzone/zone_config.rb

Overview

Contains zone configurations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ ZoneConfig

Returns a new instance of ZoneConfig.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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

Instance Attribute Details

#arpasArray<ArpaNetwork> (readonly)

Return the list of ArpaNetwork objects

Returns:

  • (Array<ArpaNetwork>)

    arpa networks



12
13
14
# File 'lib/redzone/zone_config.rb', line 12

def arpas
  @arpas
end

#zonesArray<Zone> (readonly)

Return the list of Zone objects

Returns:

  • (Array<Zone>)

    zone



9
10
11
# File 'lib/redzone/zone_config.rb', line 9

def zones
  @zones
end