Class: GoogleMapsPlatform::WiFiAccessPoint
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- GoogleMapsPlatform::WiFiAccessPoint
- Defined in:
- lib/google_maps_platform/models/wi_fi_access_point.rb
Overview
Attributes used to describe a WiFi access point.
Instance Attribute Summary collapse
-
#age ⇒ Integer
The number of milliseconds since this access point was detected.
-
#channel ⇒ Integer
The channel over which the client is communication with the access point.
-
#mac_address ⇒ String
The MAC address of the WiFi node.
-
#signal_strength ⇒ Integer
The current signal strength measured in dBm.
-
#signal_to_noise_ratio ⇒ Integer
The current signal to noise ratio measured in dB.
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(mac_address:, signal_strength: SKIP, signal_to_noise_ratio: SKIP, age: SKIP, channel: SKIP, additional_properties: nil) ⇒ WiFiAccessPoint
constructor
A new instance of WiFiAccessPoint.
-
#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(mac_address:, signal_strength: SKIP, signal_to_noise_ratio: SKIP, age: SKIP, channel: SKIP, additional_properties: nil) ⇒ WiFiAccessPoint
Returns a new instance of WiFiAccessPoint.
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 59 def initialize(mac_address:, signal_strength: SKIP, signal_to_noise_ratio: SKIP, age: SKIP, channel: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @mac_address = mac_address @signal_strength = signal_strength unless signal_strength == SKIP @signal_to_noise_ratio = signal_to_noise_ratio unless signal_to_noise_ratio == SKIP @age = age unless age == SKIP @channel = channel unless channel == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#age ⇒ Integer
The number of milliseconds since this access point was detected.
27 28 29 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 27 def age @age end |
#channel ⇒ Integer
The channel over which the client is communication with the access point.
31 32 33 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 31 def channel @channel end |
#mac_address ⇒ String
The MAC address of the WiFi node. It’s typically called a BSS, BSSID or MAC address. Separators must be : (colon).
15 16 17 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 15 def mac_address @mac_address end |
#signal_strength ⇒ Integer
The current signal strength measured in dBm.
19 20 21 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 19 def signal_strength @signal_strength end |
#signal_to_noise_ratio ⇒ Integer
The current signal to noise ratio measured in dB.
23 24 25 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 23 def signal_to_noise_ratio @signal_to_noise_ratio end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 74 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. mac_address = hash.key?('macAddress') ? hash['macAddress'] : nil signal_strength = hash.key?('signalStrength') ? hash['signalStrength'] : SKIP signal_to_noise_ratio = hash.key?('signalToNoiseRatio') ? hash['signalToNoiseRatio'] : SKIP age = hash.key?('age') ? hash['age'] : SKIP channel = hash.key?('channel') ? hash['channel'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. WiFiAccessPoint.new(mac_address: mac_address, signal_strength: signal_strength, signal_to_noise_ratio: signal_to_noise_ratio, age: age, channel: channel, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['mac_address'] = 'macAddress' @_hash['signal_strength'] = 'signalStrength' @_hash['signal_to_noise_ratio'] = 'signalToNoiseRatio' @_hash['age'] = 'age' @_hash['channel'] = 'channel' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 55 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 45 def self.optionals %w[ signal_strength signal_to_noise_ratio age channel ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
111 112 113 114 115 116 117 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 111 def inspect class_name = self.class.name.split('::').last "<#{class_name} mac_address: #{@mac_address.inspect}, signal_strength:"\ " #{@signal_strength.inspect}, signal_to_noise_ratio: #{@signal_to_noise_ratio.inspect},"\ " age: #{@age.inspect}, channel: #{@channel.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
103 104 105 106 107 108 |
# File 'lib/google_maps_platform/models/wi_fi_access_point.rb', line 103 def to_s class_name = self.class.name.split('::').last "<#{class_name} mac_address: #{@mac_address}, signal_strength: #{@signal_strength},"\ " signal_to_noise_ratio: #{@signal_to_noise_ratio}, age: #{@age}, channel: #{@channel},"\ " additional_properties: #{@additional_properties}>" end |