Class: Wifimap::Parser::SniffProbes
- Inherits:
-
Object
- Object
- Wifimap::Parser::SniffProbes
- Includes:
- Wifimap::Parsable
- Defined in:
- lib/wifimap/parser/sniff_probes.rb
Overview
Parse the content of a sniff-probes file.
Instance Attribute Summary collapse
-
#access_points ⇒ Object
readonly
Returns the value of attribute access_points.
Instance Method Summary collapse
-
#initialize(dump) ⇒ SniffProbes
constructor
A new instance of SniffProbes.
-
#stations ⇒ Array
Get the list of stations from the dump.
Methods included from Wifimap::Parsable
Constructor Details
#initialize(dump) ⇒ SniffProbes
Returns a new instance of SniffProbes.
12 13 14 15 |
# File 'lib/wifimap/parser/sniff_probes.rb', line 12 def initialize(dump) @dump = dump @access_points = [] end |
Instance Attribute Details
#access_points ⇒ Object (readonly)
Returns the value of attribute access_points.
9 10 11 |
# File 'lib/wifimap/parser/sniff_probes.rb', line 9 def access_points @access_points end |
Instance Method Details
#stations ⇒ Array
Get the list of stations from the dump.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/wifimap/parser/sniff_probes.rb', line 20 def stations unique_macs.map do |mac| station = Station.new(mac: mac) dump_rows.each do |row| fields = row.split('"') unless station.probes.include?(fields[1]) station.probes << fields[1] if fields[0].include?(mac) end end station end end |