Class: MistApi::StatsApAutoPlacement

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

Overview

StatsApAutoPlacement 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(info = SKIP, recommended_anchor = SKIP, status = SKIP, status_detail = SKIP, x = SKIP, x_m = SKIP, y = SKIP, y_m = SKIP) ⇒ StatsApAutoPlacement

Returns a new instance of StatsApAutoPlacement.



78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/mist_api/models/stats_ap_auto_placement.rb', line 78

def initialize(info = SKIP, recommended_anchor = SKIP, status = SKIP,
               status_detail = SKIP, x = SKIP, x_m = SKIP, y = SKIP,
               y_m = SKIP)
  @info = info unless info == SKIP
  @recommended_anchor = recommended_anchor unless recommended_anchor == SKIP
  @status = status unless status == SKIP
  @status_detail = status_detail unless status_detail == SKIP
  @x = x unless x == SKIP
  @x_m = x_m unless x_m == SKIP
  @y = y unless y == SKIP
  @y_m = y_m unless y_m == SKIP
end

Instance Attribute Details

#infoStatsApAutoPlacementInfo

Additional information about auto placements AP data



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

def info
  @info
end

Flag to represent if AP is recommended as an anchor by auto placement service

Returns:

  • (TrueClass | FalseClass)


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

def recommended_anchor
  @recommended_anchor
end

#statusString

Basic Placement Status

Returns:

  • (String)


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

def status
  @status
end

#status_detailString

Additional info about placement status

Returns:

  • (String)


27
28
29
# File 'lib/mist_api/models/stats_ap_auto_placement.rb', line 27

def status_detail
  @status_detail
end

#xFloat

X Autoplaced Position in pixels

Returns:

  • (Float)


31
32
33
# File 'lib/mist_api/models/stats_ap_auto_placement.rb', line 31

def x
  @x
end

#x_mFloat

X Autoplaced Position in meters

Returns:

  • (Float)


35
36
37
# File 'lib/mist_api/models/stats_ap_auto_placement.rb', line 35

def x_m
  @x_m
end

#yFloat

Y Autoplaced Position in pixels

Returns:

  • (Float)


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

def y
  @y
end

#y_mFloat

X Autoplaced Position in meters

Returns:

  • (Float)


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

def y_m
  @y_m
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/mist_api/models/stats_ap_auto_placement.rb', line 92

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  info = StatsApAutoPlacementInfo.from_hash(hash['info']) if hash['info']
  recommended_anchor =
    hash.key?('recommended_anchor') ? hash['recommended_anchor'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  status_detail = hash.key?('status_detail') ? hash['status_detail'] : SKIP
  x = hash.key?('x') ? hash['x'] : SKIP
  x_m = hash.key?('x_m') ? hash['x_m'] : SKIP
  y = hash.key?('y') ? hash['y'] : SKIP
  y_m = hash.key?('y_m') ? hash['y_m'] : SKIP

  # Create object from extracted values.
  StatsApAutoPlacement.new(info,
                           recommended_anchor,
                           status,
                           status_detail,
                           x,
                           x_m,
                           y,
                           y_m)
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/stats_ap_auto_placement.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['info'] = 'info'
  @_hash['recommended_anchor'] = 'recommended_anchor'
  @_hash['status'] = 'status'
  @_hash['status_detail'] = 'status_detail'
  @_hash['x'] = 'x'
  @_hash['x_m'] = 'x_m'
  @_hash['y'] = 'y'
  @_hash['y_m'] = 'y_m'
  @_hash
end

.nullablesObject

An array for nullable fields



74
75
76
# File 'lib/mist_api/models/stats_ap_auto_placement.rb', line 74

def self.nullables
  []
end

.optionalsObject

An array for optional fields



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/mist_api/models/stats_ap_auto_placement.rb', line 60

def self.optionals
  %w[
    info
    recommended_anchor
    status
    status_detail
    x
    x_m
    y
    y_m
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



126
127
128
129
130
131
# File 'lib/mist_api/models/stats_ap_auto_placement.rb', line 126

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} info: #{@info.inspect}, recommended_anchor: #{@recommended_anchor.inspect},"\
  " status: #{@status.inspect}, status_detail: #{@status_detail.inspect}, x: #{@x.inspect},"\
  " x_m: #{@x_m.inspect}, y: #{@y.inspect}, y_m: #{@y_m.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



118
119
120
121
122
123
# File 'lib/mist_api/models/stats_ap_auto_placement.rb', line 118

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} info: #{@info}, recommended_anchor: #{@recommended_anchor}, status:"\
  " #{@status}, status_detail: #{@status_detail}, x: #{@x}, x_m: #{@x_m}, y: #{@y}, y_m:"\
  " #{@y_m}>"
end