Class: MistApi::StatsApAutoPlacementInfo

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

Overview

Additional information about auto placements AP data

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(cluster_number = SKIP, orientation_stats = SKIP, probability_surface = SKIP) ⇒ StatsApAutoPlacementInfo

Returns a new instance of StatsApAutoPlacementInfo.



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

def initialize(cluster_number = SKIP, orientation_stats = SKIP,
               probability_surface = SKIP)
  @cluster_number = cluster_number unless cluster_number == SKIP
  @orientation_stats = orientation_stats unless orientation_stats == SKIP
  @probability_surface = probability_surface unless probability_surface == SKIP
end

Instance Attribute Details

#cluster_numberInteger

All APs sharing a given cluster number can be placed relative to each other

Returns:

  • (Integer)


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

def cluster_number
  @cluster_number
end

#orientation_statsInteger

The orientation of an AP

Returns:

  • (Integer)


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

def orientation_stats
  @orientation_stats
end

#probability_surfaceStatsApAutoPlacementInfoProbabilitySurface

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



24
25
26
# File 'lib/mist_api/models/stats_ap_auto_placement_info.rb', line 24

def probability_surface
  @probability_surface
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
72
73
# File 'lib/mist_api/models/stats_ap_auto_placement_info.rb', line 57

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  cluster_number =
    hash.key?('cluster_number') ? hash['cluster_number'] : SKIP
  orientation_stats =
    hash.key?('orientation_stats') ? hash['orientation_stats'] : SKIP
  if hash['probability_surface']
    probability_surface = StatsApAutoPlacementInfoProbabilitySurface.from_hash(hash['probability_surface'])
  end

  # Create object from extracted values.
  StatsApAutoPlacementInfo.new(cluster_number,
                               orientation_stats,
                               probability_surface)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['cluster_number'] = 'cluster_number'
  @_hash['orientation_stats'] = 'orientation_stats'
  @_hash['probability_surface'] = 'probability_surface'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    cluster_number
    orientation_stats
    probability_surface
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



83
84
85
86
87
# File 'lib/mist_api/models/stats_ap_auto_placement_info.rb', line 83

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

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} cluster_number: #{@cluster_number}, orientation_stats:"\
  " #{@orientation_stats}, probability_surface: #{@probability_surface}>"
end