Class: MistApi::StatsSdkclientNetworkConnection

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/stats_sdkclient_network_connection.rb

Overview

Various network connection info for the SDK client (if known, else omitted), with RSSI in dBm, and signal level as

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(mac = nil, rssi = nil, signal_level = nil, type = nil) ⇒ StatsSdkclientNetworkConnection

Returns a new instance of StatsSdkclientNetworkConnection.



49
50
51
52
53
54
# File 'lib/mist_api/models/stats_sdkclient_network_connection.rb', line 49

def initialize(mac = nil, rssi = nil, signal_level = nil, type = nil)
  @mac = mac
  @rssi = rssi
  @signal_level = signal_level
  @type = type
end

Instance Attribute Details

#macString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/mist_api/models/stats_sdkclient_network_connection.rb', line 15

def mac
  @mac
end

#rssiFloat

TODO: Write general description for this method

Returns:

  • (Float)


19
20
21
# File 'lib/mist_api/models/stats_sdkclient_network_connection.rb', line 19

def rssi
  @rssi
end

#signal_levelFloat

TODO: Write general description for this method

Returns:

  • (Float)


23
24
25
# File 'lib/mist_api/models/stats_sdkclient_network_connection.rb', line 23

def signal_level
  @signal_level
end

#typeString

TODO: Write general description for this method

Returns:

  • (String)


27
28
29
# File 'lib/mist_api/models/stats_sdkclient_network_connection.rb', line 27

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/mist_api/models/stats_sdkclient_network_connection.rb', line 57

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  mac = hash.key?('mac') ? hash['mac'] : nil
  rssi = hash.key?('rssi') ? hash['rssi'] : nil
  signal_level = hash.key?('signal_level') ? hash['signal_level'] : nil
  type = hash.key?('type') ? hash['type'] : nil

  # Create object from extracted values.
  StatsSdkclientNetworkConnection.new(mac,
                                      rssi,
                                      signal_level,
                                      type)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/mist_api/models/stats_sdkclient_network_connection.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['mac'] = 'mac'
  @_hash['rssi'] = 'rssi'
  @_hash['signal_level'] = 'signal_level'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



45
46
47
# File 'lib/mist_api/models/stats_sdkclient_network_connection.rb', line 45

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
# File 'lib/mist_api/models/stats_sdkclient_network_connection.rb', line 40

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



81
82
83
84
85
# File 'lib/mist_api/models/stats_sdkclient_network_connection.rb', line 81

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} mac: #{@mac.inspect}, rssi: #{@rssi.inspect}, signal_level:"\
  " #{@signal_level.inspect}, type: #{@type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



74
75
76
77
78
# File 'lib/mist_api/models/stats_sdkclient_network_connection.rb', line 74

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} mac: #{@mac}, rssi: #{@rssi}, signal_level: #{@signal_level}, type:"\
  " #{@type}>"
end