class Waps

Attributes

output[R]

Public Class Methods

new(interface_name = '') click to toggle source
# File lib/waps.rb, line 10
def initialize(interface_name = '')
        @interface_name = interface_name
        @output = []
end

Public Instance Methods

get(find) click to toggle source

Find methods

# File lib/waps.rb, line 34
def get(find)
        if (@output[0].keys.include? find.to_sym) && !@output.empty? 
                return @output.map { |cell| cell[find.to_sym] }
        end
end
scan() click to toggle source
# File lib/waps.rb, line 15
def scan
        if RUBY_PLATFORM =~ /win32/
          return {error: "Not support for windows. Coming Soon."}
        elsif RUBY_PLATFORM =~ /linux/
          new_scan = Waps_linux.new(@interface_name)
          return @output = new_scan.scan
        elsif RUBY_PLATFORM =~ /darwin/
          new_scan = Waps_mac.new
          return @output = new_scan.scan
        else
          return {error: "No support for this OS."}
        end
end