Class: Nylas::NylasDateType
- Inherits:
-
Types::ModelType
- Object
- Types::ValueType
- Types::ModelType
- Nylas::NylasDateType
- Defined in:
- lib/nylas/nylas_date.rb
Overview
Serializes, Deserializes between NylasDate objects and a Hash
Instance Attribute Summary
Attributes inherited from Types::ModelType
Instance Method Summary collapse
- #cast(value) ⇒ Object
-
#initialize ⇒ NylasDateType
constructor
A new instance of NylasDateType.
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
#initialize ⇒ NylasDateType
Returns a new instance of NylasDateType.
17 18 19 |
# File 'lib/nylas/nylas_date.rb', line 17 def initialize super(model: NylasDate) end |
Instance Method Details
#cast(value) ⇒ Object
21 22 23 |
# File 'lib/nylas/nylas_date.rb', line 21 def cast(value) value.is_a?(String) ? super({ object: "date", date: value }) : super end |