Class: Nmunch::Subscribers::Stdout

Inherits:
Base
  • Object
show all
Defined in:
lib/nmunch/subscribers/stdout.rb

Overview

Public: Node subscriber to output node details to STDOUT

This subscriber is default and will always be registered

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Nmunch::Subscribers::Base

Instance Method Details

#process(node) ⇒ Object

Public: Process a new node

node - An instance of Nmunch::Node

Prints node information to STDOUT

Returns nothing



16
17
18
19
20
# File 'lib/nmunch/subscribers/stdout.rb', line 16

def process(node)
  output =  " #{node.ip_address}\t\t#{node.mac_address}"
  output << "\t#{Nmunch::MacOuiLookup.instance.lookup(node.mac_address)}" unless options.include?("no-prefix-lookup")
  puts Paint[output, :green]
end