Class: Walkon::HciTool
- Inherits:
-
Object
- Object
- Walkon::HciTool
- Defined in:
- lib/walkon/hci_tool.rb
Instance Attribute Summary collapse
-
#results ⇒ Object
Returns the value of attribute results.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ HciTool
constructor
A new instance of HciTool.
- #scan ⇒ Object
Constructor Details
#initialize ⇒ HciTool
Returns a new instance of HciTool.
7 8 9 |
# File 'lib/walkon/hci_tool.rb', line 7 def initialize @results = [] end |
Instance Attribute Details
#results ⇒ Object
Returns the value of attribute results.
5 6 7 |
# File 'lib/walkon/hci_tool.rb', line 5 def results @results end |
Class Method Details
.scan ⇒ Object
11 12 13 |
# File 'lib/walkon/hci_tool.rb', line 11 def self.scan new.scan end |
Instance Method Details
#scan ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/walkon/hci_tool.rb', line 15 def scan @results = scan_results.reduce([]) do |collection, line| line.scan FOR_MAC_ADDRESS do |mac_address| collection << mac_address.first end collection end end |