Class: Verizon::DataFrame
- Defined in:
- lib/verizon/models/data_frame.rb
Overview
The data frame allows sending various advisory and road sign types of information to equipped devices.
Instance Attribute Summary collapse
-
#content ⇒ Object
Always set to 0 and carries no meaning.
-
#content_new ⇒ ContentFrictionInfo
It contains information that extends the original traveler data frame to enable addition of future entities.
-
#do_not_use1 ⇒ Integer
Always set to 0 and carries no meaning.
-
#do_not_use2 ⇒ Integer
Always set to 0 and carries no meaning.
-
#do_not_use3 ⇒ Integer
Always set to 0 and carries no meaning.
-
#do_not_use4 ⇒ Integer
Always set to 0 and carries no meaning.
-
#duration_time ⇒ Integer
The duration, in units of whole minutes, that a object persists for.
-
#frame_type ⇒ FrameTypeEnum
The frameType data element provides the type of message to follow in the rest of the message frame structure.
-
#msg_id ⇒ Object
The frameType data element provides the type of message to follow in the rest of the message frame structure.
-
#priority ⇒ Integer
The relative importance of the sign, on a scale from zero (least important) to seven (most important).
-
#regions ⇒ Array[GeographicalPath]
The data frame is used to support the cross-cutting need in many V2X messages to describe arbitrary spatial areas (polygons, boundary lines, and other basic shapes) required by various message types in a small message size.
-
#start_time ⇒ Integer
Start time expresses the number of elapsed minutes of the current year in the time system being used (typically UTC time).
-
#start_year ⇒ Integer
The V2X year consists of integer values from zero to 4095 representing the year according to the Gregorian calendar date system.
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(frame_type = nil, msg_id = nil, start_time = nil, duration_time = nil, priority = nil, regions = nil, content = nil, do_not_use1 = 0, start_year = SKIP, do_not_use2 = 0, do_not_use3 = 0, do_not_use4 = 0, content_new = SKIP) ⇒ DataFrame
constructor
A new instance of DataFrame.
-
#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(frame_type = nil, msg_id = nil, start_time = nil, duration_time = nil, priority = nil, regions = nil, content = nil, do_not_use1 = 0, start_year = SKIP, do_not_use2 = 0, do_not_use3 = 0, do_not_use4 = 0, content_new = SKIP) ⇒ DataFrame
Returns a new instance of DataFrame.
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/verizon/models/data_frame.rb', line 132 def initialize(frame_type = nil, msg_id = nil, start_time = nil, duration_time = nil, priority = nil, regions = nil, content = nil, do_not_use1 = 0, start_year = SKIP, do_not_use2 = 0, do_not_use3 = 0, do_not_use4 = 0, content_new = SKIP) @do_not_use1 = do_not_use1 unless do_not_use1 == SKIP @frame_type = frame_type @msg_id = msg_id @start_year = start_year unless start_year == SKIP @start_time = start_time @duration_time = duration_time @priority = priority @do_not_use2 = do_not_use2 unless do_not_use2 == SKIP @regions = regions @do_not_use3 = do_not_use3 unless do_not_use3 == SKIP @do_not_use4 = do_not_use4 unless do_not_use4 == SKIP @content = content @content_new = content_new unless content_new == SKIP end |
Instance Attribute Details
#content ⇒ Object
Always set to 0 and carries no meaning. Legacy field maintained for backward compatibility.
88 89 90 |
# File 'lib/verizon/models/data_frame.rb', line 88 def content @content end |
#content_new ⇒ ContentFrictionInfo
It contains information that extends the original traveler data frame to enable addition of future entities. Friction information is the first entity included in the new part three content.
94 95 96 |
# File 'lib/verizon/models/data_frame.rb', line 94 def content_new @content_new end |
#do_not_use1 ⇒ Integer
Always set to 0 and carries no meaning. Legacy field maintained for backward compatibility.
16 17 18 |
# File 'lib/verizon/models/data_frame.rb', line 16 def do_not_use1 @do_not_use1 end |
#do_not_use2 ⇒ Integer
Always set to 0 and carries no meaning. Legacy field maintained for backward compatibility.
64 65 66 |
# File 'lib/verizon/models/data_frame.rb', line 64 def do_not_use2 @do_not_use2 end |
#do_not_use3 ⇒ Integer
Always set to 0 and carries no meaning. Legacy field maintained for backward compatibility.
78 79 80 |
# File 'lib/verizon/models/data_frame.rb', line 78 def do_not_use3 @do_not_use3 end |
#do_not_use4 ⇒ Integer
Always set to 0 and carries no meaning. Legacy field maintained for backward compatibility.
83 84 85 |
# File 'lib/verizon/models/data_frame.rb', line 83 def do_not_use4 @do_not_use4 end |
#duration_time ⇒ Integer
The duration, in units of whole minutes, that a object persists for. A value of 32000 means that the object persists forever. The range 0..32000 provides for about 22.2 days of maximum duration.
54 55 56 |
# File 'lib/verizon/models/data_frame.rb', line 54 def duration_time @duration_time end |
#frame_type ⇒ FrameTypeEnum
The frameType data element provides the type of message to follow in the rest of the message frame structure. The following frame types are supported:
- unknown
- advisory
- roadSignage
- commercialSignage
26 27 28 |
# File 'lib/verizon/models/data_frame.rb', line 26 def frame_type @frame_type end |
#msg_id ⇒ Object
The frameType data element provides the type of message to follow in the rest of the message frame structure. The following frame types are supported:
- unknown
- advisory
- roadSignage
- commercialSignage
36 37 38 |
# File 'lib/verizon/models/data_frame.rb', line 36 def msg_id @msg_id end |
#priority ⇒ Integer
The relative importance of the sign, on a scale from zero (least important) to seven (most important).
59 60 61 |
# File 'lib/verizon/models/data_frame.rb', line 59 def priority @priority end |
#regions ⇒ Array[GeographicalPath]
The data frame is used to support the cross-cutting need in many V2X messages to describe arbitrary spatial areas (polygons, boundary lines, and other basic shapes) required by various message types in a small message size. This data frame can describe a complex path or region of arbitrary size using either one of the two supported node offset methods (XY offsets or LL offsets) or using simple geometric projections.
73 74 75 |
# File 'lib/verizon/models/data_frame.rb', line 73 def regions @regions end |
#start_time ⇒ Integer
Start time expresses the number of elapsed minutes of the current year in the time system being used (typically UTC time). The value 527040 shall be used for invalid.
48 49 50 |
# File 'lib/verizon/models/data_frame.rb', line 48 def start_time @start_time end |
#start_year ⇒ Integer
The V2X year consists of integer values from zero to 4095 representing the year according to the Gregorian calendar date system. The value of zero shall represent an unknown value.
42 43 44 |
# File 'lib/verizon/models/data_frame.rb', line 42 def start_year @start_year end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
153 154 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 |
# File 'lib/verizon/models/data_frame.rb', line 153 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. frame_type = hash.key?('frameType') ? hash['frameType'] : nil msg_id = hash.key?('msgId') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:DataFrameMsgId), hash['msgId'] ) : nil start_time = hash.key?('startTime') ? hash['startTime'] : nil duration_time = hash.key?('durationTime') ? hash['durationTime'] : nil priority = hash.key?('priority') ? hash['priority'] : nil # Parameter is an array, so we need to iterate through it regions = nil unless hash['regions'].nil? regions = [] hash['regions'].each do |structure| regions << (GeographicalPath.from_hash(structure) if structure) end end regions = nil unless hash.key?('regions') content = hash.key?('content') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:DataFrameContent), hash['content'] ) : nil do_not_use1 = hash['doNotUse1'] ||= 0 start_year = hash.key?('startYear') ? hash['startYear'] : SKIP do_not_use2 = hash['doNotUse2'] ||= 0 do_not_use3 = hash['doNotUse3'] ||= 0 do_not_use4 = hash['doNotUse4'] ||= 0 content_new = hash.key?('contentNew') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:DataFrameContentNew), hash['contentNew'] ) : SKIP # Create object from extracted values. DataFrame.new(frame_type, msg_id, start_time, duration_time, priority, regions, content, do_not_use1, start_year, do_not_use2, do_not_use3, do_not_use4, content_new) end |
.names ⇒ Object
A mapping from model property names to API property names.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/verizon/models/data_frame.rb', line 97 def self.names @_hash = {} if @_hash.nil? @_hash['do_not_use1'] = 'doNotUse1' @_hash['frame_type'] = 'frameType' @_hash['msg_id'] = 'msgId' @_hash['start_year'] = 'startYear' @_hash['start_time'] = 'startTime' @_hash['duration_time'] = 'durationTime' @_hash['priority'] = 'priority' @_hash['do_not_use2'] = 'doNotUse2' @_hash['regions'] = 'regions' @_hash['do_not_use3'] = 'doNotUse3' @_hash['do_not_use4'] = 'doNotUse4' @_hash['content'] = 'content' @_hash['content_new'] = 'contentNew' @_hash end |
.nullables ⇒ Object
An array for nullable fields
128 129 130 |
# File 'lib/verizon/models/data_frame.rb', line 128 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
116 117 118 119 120 121 122 123 124 125 |
# File 'lib/verizon/models/data_frame.rb', line 116 def self.optionals %w[ do_not_use1 start_year do_not_use2 do_not_use3 do_not_use4 content_new ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
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 |
# File 'lib/verizon/models/data_frame.rb', line 204 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.frame_type, ->(val) { FrameTypeEnum.validate(val) }) and UnionTypeLookUp.get(:DataFrameMsgId) .validate(value.msg_id) and APIHelper.valid_type?(value.start_time, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.duration_time, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.priority, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.regions, ->(val) { GeographicalPath.validate(val) }, is_model_hash: true, is_inner_model_hash: true) and UnionTypeLookUp.get(:DataFrameContent) .validate(value.content) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['frameType'], ->(val) { FrameTypeEnum.validate(val) }) and UnionTypeLookUp.get(:DataFrameMsgId) .validate(value['msgId']) and APIHelper.valid_type?(value['startTime'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['durationTime'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['priority'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['regions'], ->(val) { GeographicalPath.validate(val) }, is_model_hash: true, is_inner_model_hash: true) and UnionTypeLookUp.get(:DataFrameContent) .validate(value['content']) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
259 260 261 262 263 264 265 266 267 |
# File 'lib/verizon/models/data_frame.rb', line 259 def inspect class_name = self.class.name.split('::').last "<#{class_name} do_not_use1: #{@do_not_use1.inspect}, frame_type: #{@frame_type.inspect},"\ " msg_id: #{@msg_id.inspect}, start_year: #{@start_year.inspect}, start_time:"\ " #{@start_time.inspect}, duration_time: #{@duration_time.inspect}, priority:"\ " #{@priority.inspect}, do_not_use2: #{@do_not_use2.inspect}, regions: #{@regions.inspect},"\ " do_not_use3: #{@do_not_use3.inspect}, do_not_use4: #{@do_not_use4.inspect}, content:"\ " #{@content.inspect}, content_new: #{@content_new.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
249 250 251 252 253 254 255 256 |
# File 'lib/verizon/models/data_frame.rb', line 249 def to_s class_name = self.class.name.split('::').last "<#{class_name} do_not_use1: #{@do_not_use1}, frame_type: #{@frame_type}, msg_id:"\ " #{@msg_id}, start_year: #{@start_year}, start_time: #{@start_time}, duration_time:"\ " #{@duration_time}, priority: #{@priority}, do_not_use2: #{@do_not_use2}, regions:"\ " #{@regions}, do_not_use3: #{@do_not_use3}, do_not_use4: #{@do_not_use4}, content:"\ " #{@content}, content_new: #{@content_new}>" end |