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.
175 176 177 |
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 175 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.
170 171 172 |
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 170 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.
197 198 199 200 201 202 203 |
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 197 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.
184 185 186 187 188 |
# File 'lib/ldclient-rb/impl/data_system/protocolv2.rb', line 184 def to_h { reason: @reason, } end |