Class: Waps

Inherits:
Object
  • Object
show all
Defined in:
lib/waps.rb

Instance Method Summary collapse

Constructor Details

#initialize(interface_name = '') ⇒ Waps

Returns a new instance of Waps.



7
8
9
10
# File 'lib/waps.rb', line 7

def initialize(interface_name = '')
	@interface_name = interface_name
	@output = []
end

Instance Method Details

#get(find) ⇒ Object



31
32
33
34
35
# File 'lib/waps.rb', line 31

def get(find)
	if (@output[0].keys.include? find.to_sym) && !@output.empty? 
		return @output.map { |cell| cell[find.to_sym] }
	end
end

#scanObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/waps.rb', line 12

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