Class: Svix::MessageStatus
- Inherits:
-
Object
- Object
- Svix::MessageStatus
- Defined in:
- lib/svix/models/message_status.rb
Overview
The sending status of the message:
-
Success = 0
-
Pending = 1
-
Fail = 2
-
Sending = 3
Constant Summary collapse
- SUCCESS =
0.freeze
- PENDING =
1.freeze
- FAIL =
2.freeze
- SENDING =
3.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value) ⇒ MessageStatus
constructor
A new instance of MessageStatus.
- #serialize ⇒ Object
Constructor Details
#initialize(value) ⇒ MessageStatus
Returns a new instance of MessageStatus.
20 21 22 23 24 25 26 |
# File 'lib/svix/models/message_status.rb', line 20 def initialize(value) unless MessageStatus.all_vars.include?(value) raise "Invalid ENUM value '#{value}' for class #MessageStatus" end @value = value end |
Class Method Details
.all_vars ⇒ Object
16 17 18 |
# File 'lib/svix/models/message_status.rb', line 16 def self.all_vars @all_vars ||= [SUCCESS, PENDING, FAIL, SENDING].freeze end |
.deserialize(value) ⇒ Object
28 29 30 31 |
# File 'lib/svix/models/message_status.rb', line 28 def self.deserialize(value) return value if MessageStatus.all_vars.include?(value) raise "Invalid ENUM value '#{value}' for class #MessageStatus" end |
Instance Method Details
#serialize ⇒ Object
33 34 35 |
# File 'lib/svix/models/message_status.rb', line 33 def serialize @value end |