Class: Apscanner::Sensor
- Inherits:
-
Object
- Object
- Apscanner::Sensor
- Defined in:
- lib/apscanner/entities/sensor.rb
Instance Attribute Summary collapse
-
#access_points ⇒ Object
readonly
Returns the value of attribute access_points.
-
#community ⇒ Object
readonly
Returns the value of attribute community.
-
#ip_address ⇒ Object
readonly
Returns the value of attribute ip_address.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#type ⇒ Object
Returns the value of attribute type.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Sensor
constructor
A new instance of Sensor.
- #scan ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Sensor
Returns a new instance of Sensor.
6 7 8 9 10 11 12 13 |
# File 'lib/apscanner/entities/sensor.rb', line 6 def initialize( = {}) @port = [:port] @ip_address = [:ip_address] @community = [:community] @uuid = [:uuid] @type = [:type].to_sym @access_points = [] end |
Instance Attribute Details
#access_points ⇒ Object (readonly)
Returns the value of attribute access_points.
3 4 5 |
# File 'lib/apscanner/entities/sensor.rb', line 3 def access_points @access_points end |
#community ⇒ Object (readonly)
Returns the value of attribute community.
3 4 5 |
# File 'lib/apscanner/entities/sensor.rb', line 3 def community @community end |
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
3 4 5 |
# File 'lib/apscanner/entities/sensor.rb', line 3 def ip_address @ip_address end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
3 4 5 |
# File 'lib/apscanner/entities/sensor.rb', line 3 def port @port end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/apscanner/entities/sensor.rb', line 4 def type @type end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
3 4 5 |
# File 'lib/apscanner/entities/sensor.rb', line 3 def uuid @uuid end |
Instance Method Details
#scan ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/apscanner/entities/sensor.rb', line 15 def scan t0 = Time.now @access_points = SnmpManager.new(self).run Apscanner.logger.info("Scanned #{@access_points.count} APs from " \ "#{@ip_address} in #{(Time.now - t0).round(2)}s.") self end |