Class: WpaCliRuby::WpaCli::ScanResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/wpa_cli_ruby/wpa_cli.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ ScanResult

Returns a new instance of ScanResult.



10
11
12
13
14
# File 'lib/wpa_cli_ruby/wpa_cli.rb', line 10

def initialize(*args)
  super(*args)
  self.signal_level = self.signal_level.to_i
  self.frequency = self.frequency.to_i
end

Instance Attribute Details

#bssidObject

Returns the value of attribute bssid

Returns:

  • (Object)

    the current value of bssid



9
10
11
# File 'lib/wpa_cli_ruby/wpa_cli.rb', line 9

def bssid
  @bssid
end

#flagsObject

Returns the value of attribute flags

Returns:

  • (Object)

    the current value of flags



9
10
11
# File 'lib/wpa_cli_ruby/wpa_cli.rb', line 9

def flags
  @flags
end

#frequencyObject

Returns the value of attribute frequency

Returns:

  • (Object)

    the current value of frequency



9
10
11
# File 'lib/wpa_cli_ruby/wpa_cli.rb', line 9

def frequency
  @frequency
end

#signal_levelObject

Returns the value of attribute signal_level

Returns:

  • (Object)

    the current value of signal_level



9
10
11
# File 'lib/wpa_cli_ruby/wpa_cli.rb', line 9

def signal_level
  @signal_level
end

#ssidObject

Returns the value of attribute ssid

Returns:

  • (Object)

    the current value of ssid



9
10
11
# File 'lib/wpa_cli_ruby/wpa_cli.rb', line 9

def ssid
  @ssid
end

Class Method Details

.from_string(string) ⇒ Object

Instantiate from a tab delimited string (as given by ‘wpa_cli scan_results`)

Parameters:

  • tab (String)

    delimited string in the form bssidtfrequencytsignal leveltflagstssid



19
20
21
# File 'lib/wpa_cli_ruby/wpa_cli.rb', line 19

def self.from_string(string)
  new(*string.split("\t"))
end