Class: Verizon::ProtocolVersionEnum

Inherits:
Object
  • Object
show all
Defined in:
lib/verizon/models/protocol_version_enum.rb

Overview

The protocol version of the DENM.

Constant Summary collapse

PROTOCOL_VERSION_ENUM =
[
  # TODO: Write general description for ENUM_2
  ENUM_2 = 2
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ENUM_2) ⇒ Object



20
21
22
23
24
# File 'lib/verizon/models/protocol_version_enum.rb', line 20

def self.from_value(value, default_value = ENUM_2)
  return default_value if value.nil?

  default_value
end

.validate(value) ⇒ Object



14
15
16
17
18
# File 'lib/verizon/models/protocol_version_enum.rb', line 14

def self.validate(value)
  return false if value.nil?

  PROTOCOL_VERSION_ENUM.include?(value)
end