Class: FtcEventsClient::Point
- Inherits:
-
Object
- Object
- FtcEventsClient::Point
- Defined in:
- lib/ftc_events_client/models/point.rb
Instance Attribute Summary collapse
-
#area ⇒ Object
Returns the value of attribute area.
-
#boundary ⇒ Object
Returns the value of attribute boundary.
-
#boundary_dimension ⇒ Object
Returns the value of attribute boundary_dimension.
-
#centroid ⇒ Object
Returns the value of attribute centroid.
-
#coordinate ⇒ Object
Returns the value of attribute coordinate.
-
#coordinate_sequence ⇒ Object
Returns the value of attribute coordinate_sequence.
-
#coordinates ⇒ Object
Returns the value of attribute coordinates.
-
#dimension ⇒ Object
Returns the value of attribute dimension.
-
#envelope ⇒ Object
Returns the value of attribute envelope.
-
#envelope_internal ⇒ Object
Returns the value of attribute envelope_internal.
-
#factory ⇒ Object
Returns the value of attribute factory.
-
#geometry_type ⇒ Object
Returns the value of attribute geometry_type.
-
#interior_point ⇒ Object
Returns the value of attribute interior_point.
-
#is_empty ⇒ Object
Returns the value of attribute is_empty.
-
#is_rectangle ⇒ Object
Returns the value of attribute is_rectangle.
-
#is_simple ⇒ Object
Returns the value of attribute is_simple.
-
#is_valid ⇒ Object
Returns the value of attribute is_valid.
-
#length ⇒ Object
Returns the value of attribute length.
-
#m ⇒ Object
Returns the value of attribute m.
-
#num_geometries ⇒ Object
Returns the value of attribute num_geometries.
-
#num_points ⇒ Object
Returns the value of attribute num_points.
-
#ogc_geometry_type ⇒ Object
Returns the value of attribute ogc_geometry_type.
-
#point_on_surface ⇒ Object
Returns the value of attribute point_on_surface.
-
#precision_model ⇒ Object
Returns the value of attribute precision_model.
-
#srid ⇒ Object
Returns the value of attribute srid.
-
#user_data ⇒ Object
Returns the value of attribute user_data.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
-
#z ⇒ Object
Returns the value of attribute z.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Point
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Point
Initializes the object
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/ftc_events_client/models/point.rb', line 155 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `FtcEventsClient::Point` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `FtcEventsClient::Point`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'factory') self.factory = attributes[:'factory'] end if attributes.key?(:'user_data') self.user_data = attributes[:'user_data'] end if attributes.key?(:'srid') self.srid = attributes[:'srid'] end if attributes.key?(:'precision_model') self.precision_model = attributes[:'precision_model'] end if attributes.key?(:'num_geometries') self.num_geometries = attributes[:'num_geometries'] end if attributes.key?(:'is_simple') self.is_simple = attributes[:'is_simple'] end if attributes.key?(:'is_valid') self.is_valid = attributes[:'is_valid'] end if attributes.key?(:'area') self.area = attributes[:'area'] end if attributes.key?(:'length') self.length = attributes[:'length'] end if attributes.key?(:'centroid') self.centroid = attributes[:'centroid'] end if attributes.key?(:'interior_point') self.interior_point = attributes[:'interior_point'] end if attributes.key?(:'point_on_surface') self.point_on_surface = attributes[:'point_on_surface'] end if attributes.key?(:'envelope') self.envelope = attributes[:'envelope'] end if attributes.key?(:'envelope_internal') self.envelope_internal = attributes[:'envelope_internal'] end if attributes.key?(:'is_rectangle') self.is_rectangle = attributes[:'is_rectangle'] end if attributes.key?(:'coordinate_sequence') self.coordinate_sequence = attributes[:'coordinate_sequence'] end if attributes.key?(:'coordinates') if (value = attributes[:'coordinates']).is_a?(Array) self.coordinates = value end end if attributes.key?(:'num_points') self.num_points = attributes[:'num_points'] end if attributes.key?(:'is_empty') self.is_empty = attributes[:'is_empty'] end if attributes.key?(:'dimension') self.dimension = attributes[:'dimension'] end if attributes.key?(:'boundary_dimension') self.boundary_dimension = attributes[:'boundary_dimension'] end if attributes.key?(:'x') self.x = attributes[:'x'] end if attributes.key?(:'y') self.y = attributes[:'y'] end if attributes.key?(:'coordinate') self.coordinate = attributes[:'coordinate'] end if attributes.key?(:'geometry_type') self.geometry_type = attributes[:'geometry_type'] end if attributes.key?(:'ogc_geometry_type') self.ogc_geometry_type = attributes[:'ogc_geometry_type'] end if attributes.key?(:'boundary') self.boundary = attributes[:'boundary'] end if attributes.key?(:'z') self.z = attributes[:'z'] end if attributes.key?(:'m') self.m = attributes[:'m'] end end |
Instance Attribute Details
#area ⇒ Object
Returns the value of attribute area.
30 31 32 |
# File 'lib/ftc_events_client/models/point.rb', line 30 def area @area end |
#boundary ⇒ Object
Returns the value of attribute boundary.
68 69 70 |
# File 'lib/ftc_events_client/models/point.rb', line 68 def boundary @boundary end |
#boundary_dimension ⇒ Object
Returns the value of attribute boundary_dimension.
56 57 58 |
# File 'lib/ftc_events_client/models/point.rb', line 56 def boundary_dimension @boundary_dimension end |
#centroid ⇒ Object
Returns the value of attribute centroid.
34 35 36 |
# File 'lib/ftc_events_client/models/point.rb', line 34 def centroid @centroid end |
#coordinate ⇒ Object
Returns the value of attribute coordinate.
62 63 64 |
# File 'lib/ftc_events_client/models/point.rb', line 62 def coordinate @coordinate end |
#coordinate_sequence ⇒ Object
Returns the value of attribute coordinate_sequence.
46 47 48 |
# File 'lib/ftc_events_client/models/point.rb', line 46 def coordinate_sequence @coordinate_sequence end |
#coordinates ⇒ Object
Returns the value of attribute coordinates.
48 49 50 |
# File 'lib/ftc_events_client/models/point.rb', line 48 def coordinates @coordinates end |
#dimension ⇒ Object
Returns the value of attribute dimension.
54 55 56 |
# File 'lib/ftc_events_client/models/point.rb', line 54 def dimension @dimension end |
#envelope ⇒ Object
Returns the value of attribute envelope.
40 41 42 |
# File 'lib/ftc_events_client/models/point.rb', line 40 def envelope @envelope end |
#envelope_internal ⇒ Object
Returns the value of attribute envelope_internal.
42 43 44 |
# File 'lib/ftc_events_client/models/point.rb', line 42 def envelope_internal @envelope_internal end |
#factory ⇒ Object
Returns the value of attribute factory.
16 17 18 |
# File 'lib/ftc_events_client/models/point.rb', line 16 def factory @factory end |
#geometry_type ⇒ Object
Returns the value of attribute geometry_type.
64 65 66 |
# File 'lib/ftc_events_client/models/point.rb', line 64 def geometry_type @geometry_type end |
#interior_point ⇒ Object
Returns the value of attribute interior_point.
36 37 38 |
# File 'lib/ftc_events_client/models/point.rb', line 36 def interior_point @interior_point end |
#is_empty ⇒ Object
Returns the value of attribute is_empty.
52 53 54 |
# File 'lib/ftc_events_client/models/point.rb', line 52 def is_empty @is_empty end |
#is_rectangle ⇒ Object
Returns the value of attribute is_rectangle.
44 45 46 |
# File 'lib/ftc_events_client/models/point.rb', line 44 def is_rectangle @is_rectangle end |
#is_simple ⇒ Object
Returns the value of attribute is_simple.
26 27 28 |
# File 'lib/ftc_events_client/models/point.rb', line 26 def is_simple @is_simple end |
#is_valid ⇒ Object
Returns the value of attribute is_valid.
28 29 30 |
# File 'lib/ftc_events_client/models/point.rb', line 28 def is_valid @is_valid end |
#length ⇒ Object
Returns the value of attribute length.
32 33 34 |
# File 'lib/ftc_events_client/models/point.rb', line 32 def length @length end |
#m ⇒ Object
Returns the value of attribute m.
72 73 74 |
# File 'lib/ftc_events_client/models/point.rb', line 72 def m @m end |
#num_geometries ⇒ Object
Returns the value of attribute num_geometries.
24 25 26 |
# File 'lib/ftc_events_client/models/point.rb', line 24 def num_geometries @num_geometries end |
#num_points ⇒ Object
Returns the value of attribute num_points.
50 51 52 |
# File 'lib/ftc_events_client/models/point.rb', line 50 def num_points @num_points end |
#ogc_geometry_type ⇒ Object
Returns the value of attribute ogc_geometry_type.
66 67 68 |
# File 'lib/ftc_events_client/models/point.rb', line 66 def ogc_geometry_type @ogc_geometry_type end |
#point_on_surface ⇒ Object
Returns the value of attribute point_on_surface.
38 39 40 |
# File 'lib/ftc_events_client/models/point.rb', line 38 def point_on_surface @point_on_surface end |
#precision_model ⇒ Object
Returns the value of attribute precision_model.
22 23 24 |
# File 'lib/ftc_events_client/models/point.rb', line 22 def precision_model @precision_model end |
#srid ⇒ Object
Returns the value of attribute srid.
20 21 22 |
# File 'lib/ftc_events_client/models/point.rb', line 20 def srid @srid end |
#user_data ⇒ Object
Returns the value of attribute user_data.
18 19 20 |
# File 'lib/ftc_events_client/models/point.rb', line 18 def user_data @user_data end |
#x ⇒ Object
Returns the value of attribute x.
58 59 60 |
# File 'lib/ftc_events_client/models/point.rb', line 58 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
60 61 62 |
# File 'lib/ftc_events_client/models/point.rb', line 60 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
70 71 72 |
# File 'lib/ftc_events_client/models/point.rb', line 70 def z @z end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/ftc_events_client/models/point.rb', line 75 def self.attribute_map { :'factory' => :'factory', :'user_data' => :'userData', :'srid' => :'srid', :'precision_model' => :'precisionModel', :'num_geometries' => :'numGeometries', :'is_simple' => :'isSimple', :'is_valid' => :'isValid', :'area' => :'area', :'length' => :'length', :'centroid' => :'centroid', :'interior_point' => :'interiorPoint', :'point_on_surface' => :'pointOnSurface', :'envelope' => :'envelope', :'envelope_internal' => :'envelopeInternal', :'is_rectangle' => :'isRectangle', :'coordinate_sequence' => :'coordinateSequence', :'coordinates' => :'coordinates', :'num_points' => :'numPoints', :'is_empty' => :'isEmpty', :'dimension' => :'dimension', :'boundary_dimension' => :'boundaryDimension', :'x' => :'x', :'y' => :'y', :'coordinate' => :'coordinate', :'geometry_type' => :'geometryType', :'ogc_geometry_type' => :'ogcGeometryType', :'boundary' => :'boundary', :'z' => :'z', :'m' => :'m' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
351 352 353 |
# File 'lib/ftc_events_client/models/point.rb', line 351 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
145 146 147 148 149 150 151 |
# File 'lib/ftc_events_client/models/point.rb', line 145 def self.openapi_nullable Set.new([ :'user_data', :'coordinates', :'geometry_type', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/ftc_events_client/models/point.rb', line 110 def self.openapi_types { :'factory' => :'Object', :'user_data' => :'Object', :'srid' => :'Object', :'precision_model' => :'Object', :'num_geometries' => :'Object', :'is_simple' => :'Object', :'is_valid' => :'Object', :'area' => :'Object', :'length' => :'Object', :'centroid' => :'Object', :'interior_point' => :'Object', :'point_on_surface' => :'Object', :'envelope' => :'Object', :'envelope_internal' => :'Object', :'is_rectangle' => :'Object', :'coordinate_sequence' => :'Object', :'coordinates' => :'Object', :'num_points' => :'Object', :'is_empty' => :'Object', :'dimension' => :'Object', :'boundary_dimension' => :'Object', :'x' => :'Object', :'y' => :'Object', :'coordinate' => :'Object', :'geometry_type' => :'Object', :'ogc_geometry_type' => :'Object', :'boundary' => :'Object', :'z' => :'Object', :'m' => :'Object' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/ftc_events_client/models/point.rb', line 302 def ==(o) return true if self.equal?(o) self.class == o.class && factory == o.factory && user_data == o.user_data && srid == o.srid && precision_model == o.precision_model && num_geometries == o.num_geometries && is_simple == o.is_simple && is_valid == o.is_valid && area == o.area && length == o.length && centroid == o.centroid && interior_point == o.interior_point && point_on_surface == o.point_on_surface && envelope == o.envelope && envelope_internal == o.envelope_internal && is_rectangle == o.is_rectangle && coordinate_sequence == o.coordinate_sequence && coordinates == o.coordinates && num_points == o.num_points && is_empty == o.is_empty && dimension == o.dimension && boundary_dimension == o.boundary_dimension && x == o.x && y == o.y && coordinate == o.coordinate && geometry_type == o.geometry_type && ogc_geometry_type == o.ogc_geometry_type && boundary == o.boundary && z == o.z && m == o.m end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/ftc_events_client/models/point.rb', line 381 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model FtcEventsClient.const_get(type).build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
450 451 452 453 454 455 456 457 458 459 460 461 462 |
# File 'lib/ftc_events_client/models/point.rb', line 450 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
# File 'lib/ftc_events_client/models/point.rb', line 358 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) end end self end |
#eql?(o) ⇒ Boolean
338 339 340 |
# File 'lib/ftc_events_client/models/point.rb', line 338 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
344 345 346 |
# File 'lib/ftc_events_client/models/point.rb', line 344 def hash [factory, user_data, srid, precision_model, num_geometries, is_simple, is_valid, area, length, centroid, interior_point, point_on_surface, envelope, envelope_internal, is_rectangle, coordinate_sequence, coordinates, num_points, is_empty, dimension, boundary_dimension, x, y, coordinate, geometry_type, ogc_geometry_type, boundary, z, m].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
289 290 291 292 |
# File 'lib/ftc_events_client/models/point.rb', line 289 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
426 427 428 |
# File 'lib/ftc_events_client/models/point.rb', line 426 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
432 433 434 435 436 437 438 439 440 441 442 443 444 |
# File 'lib/ftc_events_client/models/point.rb', line 432 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
420 421 422 |
# File 'lib/ftc_events_client/models/point.rb', line 420 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
296 297 298 |
# File 'lib/ftc_events_client/models/point.rb', line 296 def valid? true end |