Class: MistApi::StatsApGpsStat
- Defined in:
- lib/mist_api/models/stats_ap_gps_stat.rb
Overview
StatsApGpsStat Model.
Instance Attribute Summary collapse
-
#accuracy ⇒ Float
The estimated accuracy or accuracy of the GPS coordinates, measured in meters.
-
#altitude ⇒ Float
The elevation of the AP above sea level, measured in meters.
-
#latitude ⇒ Float
The geographic latitude of the AP, measured in degrees.
-
#longitude ⇒ Float
The geographic longitude of the AP, measured in degrees.
-
#src ⇒ StatsApGpsStatSrcEnum
The origin of the GPS data.
-
#timestamp ⇒ Float
Epoch (seconds).
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(accuracy = SKIP, altitude = SKIP, latitude = SKIP, longitude = SKIP, src = SKIP, timestamp = SKIP) ⇒ StatsApGpsStat
constructor
A new instance of StatsApGpsStat.
-
#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(accuracy = SKIP, altitude = SKIP, latitude = SKIP, longitude = SKIP, src = SKIP, timestamp = SKIP) ⇒ StatsApGpsStat
Returns a new instance of StatsApGpsStat.
68 69 70 71 72 73 74 75 76 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 68 def initialize(accuracy = SKIP, altitude = SKIP, latitude = SKIP, longitude = SKIP, src = SKIP, = SKIP) @accuracy = accuracy unless accuracy == SKIP @altitude = altitude unless altitude == SKIP @latitude = latitude unless latitude == SKIP @longitude = longitude unless longitude == SKIP @src = src unless src == SKIP @timestamp = unless == SKIP end |
Instance Attribute Details
#accuracy ⇒ Float
The estimated accuracy or accuracy of the GPS coordinates, measured in meters.
15 16 17 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 15 def accuracy @accuracy end |
#altitude ⇒ Float
The elevation of the AP above sea level, measured in meters.
19 20 21 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 19 def altitude @altitude end |
#latitude ⇒ Float
The geographic latitude of the AP, measured in degrees.
23 24 25 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 23 def latitude @latitude end |
#longitude ⇒ Float
The geographic longitude of the AP, measured in degrees.
27 28 29 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 27 def longitude @longitude end |
#src ⇒ StatsApGpsStatSrcEnum
The origin of the GPS data. enum: ‘gps`: from this device GPS estimates, `other_ap` from neighboring device GPS estimates. Note: API responses may return `other_aps` which should be treated as `other_ap`
33 34 35 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 33 def src @src end |
#timestamp ⇒ Float
Epoch (seconds)
37 38 39 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 37 def @timestamp end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 79 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. accuracy = hash.key?('accuracy') ? hash['accuracy'] : SKIP altitude = hash.key?('altitude') ? hash['altitude'] : SKIP latitude = hash.key?('latitude') ? hash['latitude'] : SKIP longitude = hash.key?('longitude') ? hash['longitude'] : SKIP src = hash.key?('src') ? hash['src'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP # Create object from extracted values. StatsApGpsStat.new(accuracy, altitude, latitude, longitude, src, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 40 def self.names @_hash = {} if @_hash.nil? @_hash['accuracy'] = 'accuracy' @_hash['altitude'] = 'altitude' @_hash['latitude'] = 'latitude' @_hash['longitude'] = 'longitude' @_hash['src'] = 'src' @_hash['timestamp'] = 'timestamp' @_hash end |
.nullables ⇒ Object
An array for nullable fields
64 65 66 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 64 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 52 def self.optionals %w[ accuracy altitude latitude longitude src timestamp ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
107 108 109 110 111 112 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 107 def inspect class_name = self.class.name.split('::').last "<#{class_name} accuracy: #{@accuracy.inspect}, altitude: #{@altitude.inspect}, latitude:"\ " #{@latitude.inspect}, longitude: #{@longitude.inspect}, src: #{@src.inspect}, timestamp:"\ " #{@timestamp.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
100 101 102 103 104 |
# File 'lib/mist_api/models/stats_ap_gps_stat.rb', line 100 def to_s class_name = self.class.name.split('::').last "<#{class_name} accuracy: #{@accuracy}, altitude: #{@altitude}, latitude: #{@latitude},"\ " longitude: #{@longitude}, src: #{@src}, timestamp: #{@timestamp}>" end |