Module: Ronin::DB::CLI::Printing

Defined in:
lib/ronin/db/cli/printing.rb

Overview

Helper methods for printing Ronin::DB records.

Since:

  • 0.2.0

Instance Method Summary collapse

Instance Method Details

#record_type(record) ⇒ String?

Maps a record to a human readable display name.

Parameters:

  • record (Ronin::DB::IPAddress, Ronin::DB::MACAddress, Ronin::DB::HostName, Ronin::DB::Port, Ronin::DB::Service, Ronin::DB::OpenPort)

Returns:

  • (String, nil)

    The human readable type or nil if the record model is unknown.

Since:

  • 0.2.0



45
46
47
48
49
50
51
52
53
54
# File 'lib/ronin/db/cli/printing.rb', line 45

def record_type(record)
  case record
  when HostName   then 'host'
  when IPAddress  then 'IP'
  when MACAddress then 'MAC'
  when Port       then 'port'
  when Service    then 'service'
  when OpenPort   then 'open port'
  end
end