Class: Copian::Collector::CiscoPortsCollector

Inherits:
PortsCollector show all
Defined in:
lib/copian/collector/cisco/ports.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(manager, vlans_collector) ⇒ CiscoPortsCollector

Returns a new instance of CiscoPortsCollector.



4
5
6
7
# File 'lib/copian/collector/cisco/ports.rb', line 4

def initialize(manager, vlans_collector)
  super(manager)
  @vlans_collector = vlans_collector
end

Instance Method Details

#collectObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/copian/collector/cisco/ports.rb', line 8

def collect
  each_vlan do |manager|
    mac_bridge_ports = gather_mac_bridge_ports(manager)
    bridge_port_iface = gather_bridge_port_ifaces(manager)

    # Now we stitch the two lists together
    mac_bridge_ports.each do |bridge_port, addresses|
      yield bridge_port_iface[bridge_port], addresses
    end
  end
end