Class: Wifimap::Parser::SniffProbes
- Inherits:
-
Object
- Object
- Wifimap::Parser::SniffProbes
- 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 ⇒ Object
Get the list of stations from the dump.
Constructor Details
#initialize(dump) ⇒ SniffProbes
Returns a new instance of SniffProbes.
11 12 13 14 |
# File 'lib/wifimap/parser/sniff_probes.rb', line 11 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 ⇒ Object
Get the list of stations from the dump.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/wifimap/parser/sniff_probes.rb', line 17 def stations unique_macs.map do |mac| station = Station.new(mac: mac) 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 |