Class: Svix::StartingPosition
- Inherits:
-
Object
- Object
- Svix::StartingPosition
- Defined in:
- lib/svix/models/starting_position.rb
Constant Summary collapse
- EARLIEST =
"earliest".freeze
- LATEST =
"latest".freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value) ⇒ StartingPosition
constructor
A new instance of StartingPosition.
- #serialize ⇒ Object
Constructor Details
#initialize(value) ⇒ StartingPosition
Returns a new instance of StartingPosition.
12 13 14 15 16 17 18 |
# File 'lib/svix/models/starting_position.rb', line 12 def initialize(value) unless StartingPosition.all_vars.include?(value) raise "Invalid ENUM value '#{value}' for class #StartingPosition" end @value = value end |
Class Method Details
.all_vars ⇒ Object
8 9 10 |
# File 'lib/svix/models/starting_position.rb', line 8 def self.all_vars @all_vars ||= [EARLIEST, LATEST].freeze end |
.deserialize(value) ⇒ Object
20 21 22 23 |
# File 'lib/svix/models/starting_position.rb', line 20 def self.deserialize(value) return value if StartingPosition.all_vars.include?(value) raise "Invalid ENUM value '#{value}' for class #StartingPosition" end |
Instance Method Details
#serialize ⇒ Object
25 26 27 |
# File 'lib/svix/models/starting_position.rb', line 25 def serialize @value end |