Class: Verizon::RoadSignId
- Defined in:
- lib/verizon/models/road_sign_id.rb
Overview
It provide a precise location of one or more roadside signs.
Instance Attribute Summary collapse
-
#position ⇒ Position
It provides a precise location in the WGS-84 coordinate system, from which short offsets may be used to create additional data using a flat earth projection centered on this location.
-
#view_angle ⇒ String
It provides a precise location in the WGS-84 coordinate system, from which short offsets may be used to create additional data using a flat earth projection centered on this location.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(position:, view_angle:) ⇒ RoadSignId
constructor
A new instance of RoadSignId.
-
#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(position:, view_angle:) ⇒ RoadSignId
Returns a new instance of RoadSignId.
42 43 44 45 |
# File 'lib/verizon/models/road_sign_id.rb', line 42 def initialize(position:, view_angle:) @position = position @view_angle = view_angle end |
Instance Attribute Details
#position ⇒ Position
It provides a precise location in the WGS-84 coordinate system, from which short offsets may be used to create additional data using a flat earth projection centered on this location.
16 17 18 |
# File 'lib/verizon/models/road_sign_id.rb', line 16 def position @position end |
#view_angle ⇒ String
It provides a precise location in the WGS-84 coordinate system, from which short offsets may be used to create additional data using a flat earth projection centered on this location.
22 23 24 |
# File 'lib/verizon/models/road_sign_id.rb', line 22 def view_angle @view_angle end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/verizon/models/road_sign_id.rb', line 48 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. position = Position.from_hash(hash['position']) if hash['position'] view_angle = hash.key?('viewAngle') ? hash['viewAngle'] : nil # Create object from extracted values. RoadSignId.new(position: position, view_angle: view_angle) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 |
# File 'lib/verizon/models/road_sign_id.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['position'] = 'position' @_hash['view_angle'] = 'viewAngle' @_hash end |
.nullables ⇒ Object
An array for nullable fields
38 39 40 |
# File 'lib/verizon/models/road_sign_id.rb', line 38 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
33 34 35 |
# File 'lib/verizon/models/road_sign_id.rb', line 33 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/verizon/models/road_sign_id.rb', line 62 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.position, ->(val) { Position.validate(val) }, is_model_hash: true) and APIHelper.valid_type?(value.view_angle, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['position'], ->(val) { Position.validate(val) }, is_model_hash: true) and APIHelper.valid_type?(value['viewAngle'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
91 92 93 94 |
# File 'lib/verizon/models/road_sign_id.rb', line 91 def inspect class_name = self.class.name.split('::').last "<#{class_name} position: #{@position.inspect}, view_angle: #{@view_angle.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
85 86 87 88 |
# File 'lib/verizon/models/road_sign_id.rb', line 85 def to_s class_name = self.class.name.split('::').last "<#{class_name} position: #{@position}, view_angle: #{@view_angle}>" end |