Class: MistApi::StatsUnconnectedClient
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::StatsUnconnectedClient
- Defined in:
- lib/mist_api/models/stats_unconnected_client.rb
Overview
Unconnected clients statistics
Instance Attribute Summary collapse
-
#ap_mac ⇒ String
MAC address of the AP that heard the client.
-
#last_seen ⇒ Float
Last seen timestamp.
-
#mac ⇒ String
MAC address of the (unconnected) client.
-
#manufacture ⇒ String
Device manufacture, through fingerprinting or OUI.
-
#map_id ⇒ UUID | String
Map_id of the client (if known), or null.
-
#rssi ⇒ Integer
Client RSSI observed by the AP that heard the client (in dBm).
-
#x ⇒ Float
X (in pixels) of user location on the map (if known).
-
#y ⇒ Float
Y (in pixels) of user location on the map (if known).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(ap_mac = nil, mac = nil, manufacture = nil, rssi = nil, y = nil, last_seen = SKIP, map_id = SKIP, x = SKIP) ⇒ StatsUnconnectedClient
constructor
A new instance of StatsUnconnectedClient.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(ap_mac = nil, mac = nil, manufacture = nil, rssi = nil, y = nil, last_seen = SKIP, map_id = SKIP, x = SKIP) ⇒ StatsUnconnectedClient
Returns a new instance of StatsUnconnectedClient.
75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 75 def initialize(ap_mac = nil, mac = nil, manufacture = nil, rssi = nil, y = nil, last_seen = SKIP, map_id = SKIP, x = SKIP) @ap_mac = ap_mac @last_seen = last_seen unless last_seen == SKIP @mac = mac @manufacture = manufacture @map_id = map_id unless map_id == SKIP @rssi = rssi @x = x unless x == SKIP @y = y end |
Instance Attribute Details
#ap_mac ⇒ String
MAC address of the AP that heard the client
14 15 16 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 14 def ap_mac @ap_mac end |
#last_seen ⇒ Float
Last seen timestamp
18 19 20 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 18 def last_seen @last_seen end |
#mac ⇒ String
MAC address of the (unconnected) client
22 23 24 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 22 def mac @mac end |
#manufacture ⇒ String
Device manufacture, through fingerprinting or OUI
26 27 28 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 26 def manufacture @manufacture end |
#map_id ⇒ UUID | String
Map_id of the client (if known), or null
30 31 32 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 30 def map_id @map_id end |
#rssi ⇒ Integer
Client RSSI observed by the AP that heard the client (in dBm)
34 35 36 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 34 def rssi @rssi end |
#x ⇒ Float
X (in pixels) of user location on the map (if known)
38 39 40 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 38 def x @x end |
#y ⇒ Float
Y (in pixels) of user location on the map (if known)
42 43 44 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 42 def y @y end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ap_mac = hash.key?('ap_mac') ? hash['ap_mac'] : nil mac = hash.key?('mac') ? hash['mac'] : nil manufacture = hash.key?('manufacture') ? hash['manufacture'] : nil rssi = hash.key?('rssi') ? hash['rssi'] : nil y = hash.key?('y') ? hash['y'] : nil last_seen = hash.key?('last_seen') ? hash['last_seen'] : SKIP map_id = hash.key?('map_id') ? hash['map_id'] : SKIP x = hash.key?('x') ? hash['x'] : SKIP # Create object from extracted values. StatsUnconnectedClient.new(ap_mac, mac, manufacture, rssi, y, last_seen, map_id, x) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['ap_mac'] = 'ap_mac' @_hash['last_seen'] = 'last_seen' @_hash['mac'] = 'mac' @_hash['manufacture'] = 'manufacture' @_hash['map_id'] = 'map_id' @_hash['rssi'] = 'rssi' @_hash['x'] = 'x' @_hash['y'] = 'y' @_hash end |
.nullables ⇒ Object
An array for nullable fields
68 69 70 71 72 73 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 68 def self.nullables %w[ last_seen map_id ] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 65 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 59 def self.optionals %w[ last_seen map_id x ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
120 121 122 123 124 125 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 120 def inspect class_name = self.class.name.split('::').last "<#{class_name} ap_mac: #{@ap_mac.inspect}, last_seen: #{@last_seen.inspect}, mac:"\ " #{@mac.inspect}, manufacture: #{@manufacture.inspect}, map_id: #{@map_id.inspect}, rssi:"\ " #{@rssi.inspect}, x: #{@x.inspect}, y: #{@y.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
113 114 115 116 117 |
# File 'lib/mist_api/models/stats_unconnected_client.rb', line 113 def to_s class_name = self.class.name.split('::').last "<#{class_name} ap_mac: #{@ap_mac}, last_seen: #{@last_seen}, mac: #{@mac}, manufacture:"\ " #{@manufacture}, map_id: #{@map_id}, rssi: #{@rssi}, x: #{@x}, y: #{@y}>" end |