Class: Verizon::MessageStandardEnum
- Inherits:
-
Object
- Object
- Verizon::MessageStandardEnum
- Defined in:
- lib/verizon/models/message_standard_enum.rb
Overview
Select which V2X messaging standard will be used for the message generation. The following options are supported: - “etsi”: The message will be generated using the ETSI (European) standard (e.g. DENM). - “sae”: The message will be generated using the SAE J2735 (North American) standard (e.g. RSA, TIM). - if not sent while POST, defaults to “sae” - mandatory to send “etsi” standard here, if ETSI messages are being sent in config
Constant Summary collapse
- MESSAGE_STANDARD_ENUM =
[ # TODO: Write general description for ETSI ETSI = 'etsi'.freeze, # TODO: Write general description for SAE SAE = 'sae'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = ETSI) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/verizon/models/message_standard_enum.rb', line 28 def self.from_value(value, default_value = ETSI) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'etsi' then ETSI when 'sae' then SAE else default_value end end |
.validate(value) ⇒ Object
22 23 24 25 26 |
# File 'lib/verizon/models/message_standard_enum.rb', line 22 def self.validate(value) return false if value.nil? MESSAGE_STANDARD_ENUM.include?(value) end |