Class: RedZone::ZoneConfig
- Inherits:
-
Object
- Object
- RedZone::ZoneConfig
- Defined in:
- lib/redzone/zone_config.rb
Overview
Contains zone configurations
Instance Attribute Summary collapse
-
#arpas ⇒ Array<ArpaNetwork>
readonly
Return the list of ArpaNetwork objects.
-
#zones ⇒ Array<Zone>
readonly
Return the list of Zone objects.
Instance Method Summary collapse
-
#initialize(file) ⇒ ZoneConfig
constructor
A new instance of ZoneConfig.
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
#arpas ⇒ Array<ArpaNetwork> (readonly)
Return the list of ArpaNetwork objects
12 13 14 |
# File 'lib/redzone/zone_config.rb', line 12 def arpas @arpas end |
#zones ⇒ Array<Zone> (readonly)
Return the list of Zone objects
9 10 11 |
# File 'lib/redzone/zone_config.rb', line 9 def zones @zones end |