Class: MistApi::RrmConsideration

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

Overview

RrmConsideration Model.

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(channel = nil, noise = nil, util_score = nil, util_score_non_wifi = nil, util_score_other = nil, other_rssi = SKIP, other_ssid = SKIP, rssi = SKIP) ⇒ RrmConsideration

Returns a new instance of RrmConsideration.



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/mist_api/models/rrm_consideration.rb', line 73

def initialize(channel = nil, noise = nil, util_score = nil,
               util_score_non_wifi = nil, util_score_other = nil,
               other_rssi = SKIP, other_ssid = SKIP, rssi = SKIP)
  @channel = channel
  @noise = noise
  @other_rssi = other_rssi unless other_rssi == SKIP
  @other_ssid = other_ssid unless other_ssid == SKIP
  @rssi = rssi unless rssi == SKIP
  @util_score = util_score
  @util_score_non_wifi = util_score_non_wifi
  @util_score_other = util_score_other
end

Instance Attribute Details

#channelInteger

TODO: Write general description for this method

Returns:

  • (Integer)


14
15
16
# File 'lib/mist_api/models/rrm_consideration.rb', line 14

def channel
  @channel
end

#noiseFloat

TODO: Write general description for this method

Returns:

  • (Float)


18
19
20
# File 'lib/mist_api/models/rrm_consideration.rb', line 18

def noise
  @noise
end

#other_rssiFloat

Avg RSSI heard from other APs (that does NOT belongs to the same site)

Returns:

  • (Float)


22
23
24
# File 'lib/mist_api/models/rrm_consideration.rb', line 22

def other_rssi
  @other_rssi
end

#other_ssidString

SSID from other AP that we heard from with the max RSSI

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/rrm_consideration.rb', line 26

def other_ssid
  @other_ssid
end

#rssiFloat

Avg RSSI heard from APs (that belongs to the same site)

Returns:

  • (Float)


30
31
32
# File 'lib/mist_api/models/rrm_consideration.rb', line 30

def rssi
  @rssi
end

#util_scoreFloat

utilization score, 0-1, lower means less utilization (cleaner RF)

Returns:

  • (Float)


34
35
36
# File 'lib/mist_api/models/rrm_consideration.rb', line 34

def util_score
  @util_score
end

#util_score_non_wifiFloat

non-Wi-Fi utilization score, 0-1, lower means less utilization (cleaner RF)

Returns:

  • (Float)


39
40
41
# File 'lib/mist_api/models/rrm_consideration.rb', line 39

def util_score_non_wifi
  @util_score_non_wifi
end

#util_score_otherFloat

other utilization score, 0-1, lower means less utilization (cleaner RF)

Returns:

  • (Float)


43
44
45
# File 'lib/mist_api/models/rrm_consideration.rb', line 43

def util_score_other
  @util_score_other
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/mist_api/models/rrm_consideration.rb', line 87

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  channel = hash.key?('channel') ? hash['channel'] : nil
  noise = hash.key?('noise') ? hash['noise'] : nil
  util_score = hash.key?('util_score') ? hash['util_score'] : nil
  util_score_non_wifi =
    hash.key?('util_score_non_wifi') ? hash['util_score_non_wifi'] : nil
  util_score_other =
    hash.key?('util_score_other') ? hash['util_score_other'] : nil
  other_rssi = hash.key?('other_rssi') ? hash['other_rssi'] : SKIP
  other_ssid = hash.key?('other_ssid') ? hash['other_ssid'] : SKIP
  rssi = hash.key?('rssi') ? hash['rssi'] : SKIP

  # Create object from extracted values.
  RrmConsideration.new(channel,
                       noise,
                       util_score,
                       util_score_non_wifi,
                       util_score_other,
                       other_rssi,
                       other_ssid,
                       rssi)
end

.namesObject

A mapping from model property names to API property names.



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/mist_api/models/rrm_consideration.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['channel'] = 'channel'
  @_hash['noise'] = 'noise'
  @_hash['other_rssi'] = 'other_rssi'
  @_hash['other_ssid'] = 'other_ssid'
  @_hash['rssi'] = 'rssi'
  @_hash['util_score'] = 'util_score'
  @_hash['util_score_non_wifi'] = 'util_score_non_wifi'
  @_hash['util_score_other'] = 'util_score_other'
  @_hash
end

.nullablesObject

An array for nullable fields



69
70
71
# File 'lib/mist_api/models/rrm_consideration.rb', line 69

def self.nullables
  []
end

.optionalsObject

An array for optional fields



60
61
62
63
64
65
66
# File 'lib/mist_api/models/rrm_consideration.rb', line 60

def self.optionals
  %w[
    other_rssi
    other_ssid
    rssi
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



122
123
124
125
126
127
128
# File 'lib/mist_api/models/rrm_consideration.rb', line 122

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} channel: #{@channel.inspect}, noise: #{@noise.inspect}, other_rssi:"\
  " #{@other_rssi.inspect}, other_ssid: #{@other_ssid.inspect}, rssi: #{@rssi.inspect},"\
  " util_score: #{@util_score.inspect}, util_score_non_wifi: #{@util_score_non_wifi.inspect},"\
  " util_score_other: #{@util_score_other.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



114
115
116
117
118
119
# File 'lib/mist_api/models/rrm_consideration.rb', line 114

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} channel: #{@channel}, noise: #{@noise}, other_rssi: #{@other_rssi},"\
  " other_ssid: #{@other_ssid}, rssi: #{@rssi}, util_score: #{@util_score},"\
  " util_score_non_wifi: #{@util_score_non_wifi}, util_score_other: #{@util_score_other}>"
end