Class: MistApi::MapSiteReplaceFileJsonTransform
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::MapSiteReplaceFileJsonTransform
- Defined in:
- lib/mist_api/models/map_site_replace_file_json_transform.rb
Overview
If ‘transform` is provided, all the locations of the objects on the map (AP, Zone, Vbeacon, Beacon) will be transformed as well (relative to the new Map)
Instance Attribute Summary collapse
-
#rotation ⇒ Float
Whether to rotate the replacing image, in degrees.
-
#scale ⇒ Float
Whether to scale the replacing image.
-
#x ⇒ Float
Where the (0, 0) of the new image is relative to the original map.
-
#y ⇒ Float
Where the (0, 0) of the new image is relative to the original map.
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(rotation = 0, scale = 1, x = 0, y = 0) ⇒ MapSiteReplaceFileJsonTransform
constructor
A new instance of MapSiteReplaceFileJsonTransform.
-
#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(rotation = 0, scale = 1, x = 0, y = 0) ⇒ MapSiteReplaceFileJsonTransform
Returns a new instance of MapSiteReplaceFileJsonTransform.
54 55 56 57 58 59 |
# File 'lib/mist_api/models/map_site_replace_file_json_transform.rb', line 54 def initialize(rotation = 0, scale = 1, x = 0, y = 0) @rotation = rotation unless rotation == SKIP @scale = scale unless scale == SKIP @x = x unless x == SKIP @y = y unless y == SKIP end |
Instance Attribute Details
#rotation ⇒ Float
Whether to rotate the replacing image, in degrees
15 16 17 |
# File 'lib/mist_api/models/map_site_replace_file_json_transform.rb', line 15 def rotation @rotation end |
#scale ⇒ Float
Whether to scale the replacing image
19 20 21 |
# File 'lib/mist_api/models/map_site_replace_file_json_transform.rb', line 19 def scale @scale end |
#x ⇒ Float
Where the (0, 0) of the new image is relative to the original map
23 24 25 |
# File 'lib/mist_api/models/map_site_replace_file_json_transform.rb', line 23 def x @x end |
#y ⇒ Float
Where the (0, 0) of the new image is relative to the original map
27 28 29 |
# File 'lib/mist_api/models/map_site_replace_file_json_transform.rb', line 27 def y @y end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/mist_api/models/map_site_replace_file_json_transform.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. rotation = hash['rotation'] ||= 0 scale = hash['scale'] ||= 1 x = hash['x'] ||= 0 y = hash['y'] ||= 0 # Create object from extracted values. MapSiteReplaceFileJsonTransform.new(rotation, scale, x, y) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/mist_api/models/map_site_replace_file_json_transform.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['rotation'] = 'rotation' @_hash['scale'] = 'scale' @_hash['x'] = 'x' @_hash['y'] = 'y' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/mist_api/models/map_site_replace_file_json_transform.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/mist_api/models/map_site_replace_file_json_transform.rb', line 40 def self.optionals %w[ rotation scale x y ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
85 86 87 88 89 |
# File 'lib/mist_api/models/map_site_replace_file_json_transform.rb', line 85 def inspect class_name = self.class.name.split('::').last "<#{class_name} rotation: #{@rotation.inspect}, scale: #{@scale.inspect}, x: #{@x.inspect},"\ " y: #{@y.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
79 80 81 82 |
# File 'lib/mist_api/models/map_site_replace_file_json_transform.rb', line 79 def to_s class_name = self.class.name.split('::').last "<#{class_name} rotation: #{@rotation}, scale: #{@scale}, x: #{@x}, y: #{@y}>" end |