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
OctetStrings are described as hexadecimal strings, where each octet is represented by two hexadecimal characters.
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 = nil, view_angle = nil) ⇒ 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 = nil, view_angle = nil) ⇒ RoadSignID
Returns a new instance of RoadSignID.
41 42 43 44 |
# File 'lib/verizon/models/road_sign_id.rb', line 41 def initialize(position = nil, view_angle = nil) @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
OctetStrings are described as hexadecimal strings, where each octet is represented by two hexadecimal characters.
21 22 23 |
# File 'lib/verizon/models/road_sign_id.rb', line 21 def view_angle @view_angle end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/verizon/models/road_sign_id.rb', line 47 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, view_angle) end |
.names ⇒ Object
A mapping from model property names to API property names.
24 25 26 27 28 29 |
# File 'lib/verizon/models/road_sign_id.rb', line 24 def self.names @_hash = {} if @_hash.nil? @_hash['position'] = 'position' @_hash['view_angle'] = 'viewAngle' @_hash end |
.nullables ⇒ Object
An array for nullable fields
37 38 39 |
# File 'lib/verizon/models/road_sign_id.rb', line 37 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
32 33 34 |
# File 'lib/verizon/models/road_sign_id.rb', line 32 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/verizon/models/road_sign_id.rb', line 61 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.
90 91 92 93 |
# File 'lib/verizon/models/road_sign_id.rb', line 90 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.
84 85 86 87 |
# File 'lib/verizon/models/road_sign_id.rb', line 84 def to_s class_name = self.class.name.split('::').last "<#{class_name} position: #{@position}, view_angle: #{@view_angle}>" end |