Class: MistApi::StatsApAutoPlacementInfoProbabilitySurface

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

Overview

Coordinates representing a circle where the AP is most likely exists in the event of an inaccurate placement result

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(radius = SKIP, radius_m = SKIP, x = SKIP) ⇒ StatsApAutoPlacementInfoProbabilitySurface

Returns a new instance of StatsApAutoPlacementInfoProbabilitySurface.



48
49
50
51
52
# File 'lib/mist_api/models/stats_ap_auto_placement_info_probability_surface.rb', line 48

def initialize(radius = SKIP, radius_m = SKIP, x = SKIP)
  @radius = radius unless radius == SKIP
  @radius_m = radius_m unless radius_m == SKIP
  @x = x unless x == SKIP
end

Instance Attribute Details

#radiusFloat

The radius representing placement uncertainty, measured in pixels

Returns:

  • (Float)


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

def radius
  @radius
end

#radius_mFloat

The radius representing placement uncertainty, measured in meters

Returns:

  • (Float)


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

def radius_m
  @radius_m
end

#xFloat

Y-coordinate of the potential placement’s center, measured in pixels

Returns:

  • (Float)


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

def x
  @x
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/mist_api/models/stats_ap_auto_placement_info_probability_surface.rb', line 55

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  radius = hash.key?('radius') ? hash['radius'] : SKIP
  radius_m = hash.key?('radius_m') ? hash['radius_m'] : SKIP
  x = hash.key?('x') ? hash['x'] : SKIP

  # Create object from extracted values.
  StatsApAutoPlacementInfoProbabilitySurface.new(radius,
                                                 radius_m,
                                                 x)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/mist_api/models/stats_ap_auto_placement_info_probability_surface.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['radius'] = 'radius'
  @_hash['radius_m'] = 'radius_m'
  @_hash['x'] = 'x'
  @_hash
end

.nullablesObject

An array for nullable fields



44
45
46
# File 'lib/mist_api/models/stats_ap_auto_placement_info_probability_surface.rb', line 44

def self.nullables
  []
end

.optionalsObject

An array for optional fields



35
36
37
38
39
40
41
# File 'lib/mist_api/models/stats_ap_auto_placement_info_probability_surface.rb', line 35

def self.optionals
  %w[
    radius
    radius_m
    x
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



76
77
78
79
80
# File 'lib/mist_api/models/stats_ap_auto_placement_info_probability_surface.rb', line 76

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} radius: #{@radius.inspect}, radius_m: #{@radius_m.inspect}, x:"\
  " #{@x.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



70
71
72
73
# File 'lib/mist_api/models/stats_ap_auto_placement_info_probability_surface.rb', line 70

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} radius: #{@radius}, radius_m: #{@radius_m}, x: #{@x}>"
end