Class: Nylas::DeltaType
- Inherits:
-
Types::ModelType
- Object
- Types::ValueType
- Types::ModelType
- Nylas::DeltaType
- Defined in:
- lib/nylas/delta.rb
Overview
Casts Delta data from either a webhook or a delta stream to a Delta
Instance Attribute Summary
Attributes inherited from Types::ModelType
Instance Method Summary collapse
- #cast(data) ⇒ Object
-
#initialize ⇒ DeltaType
constructor
A new instance of DeltaType.
Methods inherited from Types::ModelType
#actual_attributes, #already_cast?, #json_key_from_attribute_name, #serialize, #serialize_for_api
Methods inherited from Types::ValueType
#deseralize, #serialize, #serialize_for_api
Constructor Details
Instance Method Details
#cast(data) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/nylas/delta.rb', line 43 def cast(data) data = if data.key?(:object_data) object_data = data.delete(:object_data) data.merge(object_data) else data end data = data.merge(data[:attributes]) if data[:attributes] data[:object_attributes] = data.delete(:attributes) super(**data) end |