Class: LaunchDarkly::Impl::DataSystem::ProtocolV2::Goodbye Private
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::DataSystem::ProtocolV2::Goodbye
- Defined in:
- lib/ldclient-rb/impl/data_system/protocolv2.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Goodbye represents a goodbye event.
Instance Attribute Summary collapse
-
#reason ⇒ String
readonly
private
The reason for goodbye.
Class Method Summary collapse
-
.from_h(data) ⇒ Goodbye
private
Deserializes a Goodbye event from a JSON-compatible hash.
Instance Method Summary collapse
-
#initialize(reason:) ⇒ Goodbye
constructor
private
A new instance of Goodbye.
-
#to_h ⇒ Hash
private
Serializes the Goodbye to a JSON-compatible hash.
Constructor Details
#initialize(reason:) ⇒ Goodbye
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Goodbye.
157 158 159 |
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 157 def initialize(reason:) @reason = reason end |
Instance Attribute Details
#reason ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The reason for goodbye.
152 153 154 |
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 152 def reason @reason end |
Class Method Details
.from_h(data) ⇒ Goodbye
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Deserializes a Goodbye event from a JSON-compatible hash.
179 180 181 182 183 184 185 |
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 179 def self.from_h(data) reason = data[:reason] raise ArgumentError, "Missing required fields in Goodbye" if reason.nil? new(reason: reason) end |
Instance Method Details
#to_h ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Serializes the Goodbye to a JSON-compatible hash.
166 167 168 169 170 |
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 166 def to_h { reason: @reason, } end |