Class: MsRestAzure::SubResource
- Inherits:
-
Object
- Object
- MsRestAzure::SubResource
- Defined in:
- lib/ms_rest_azure/sub_resource.rb
Overview
Class which represents any Azure subresource.
Instance Attribute Summary collapse
-
#id ⇒ String
The id of the subresource.
Class Method Summary collapse
-
.deserialize_object(object) ⇒ SubResource
Deserializes given hash object into subresource.
-
.serialize_object(object) ⇒ Hash
Serializes given subresource object into hash.
Instance Method Summary collapse
-
#validate ⇒ Object
Validates the subresource.
Instance Attribute Details
#id ⇒ String
Returns the id of the subresource.
12 13 14 |
# File 'lib/ms_rest_azure/sub_resource.rb', line 12 def id @id end |
Class Method Details
.deserialize_object(object) ⇒ SubResource
Deserializes given hash object into subresource.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/ms_rest_azure/sub_resource.rb', line 34 def self.deserialize_object(object) return if object.nil? output_object = SubResource.new deserialized_property = object['id'] output_object.id = deserialized_property output_object.validate output_object end |
.serialize_object(object) ⇒ Hash
Serializes given subresource object into hash.
19 20 21 22 23 24 25 26 27 |
# File 'lib/ms_rest_azure/sub_resource.rb', line 19 def self.serialize_object(object) object.validate output_object = {} serialized_property = object.id output_object['id'] = serialized_property unless serialized_property.nil? output_object end |
Instance Method Details
#validate ⇒ Object
Validates the subresource. Throws error if there is any property is incorrect.
48 49 |
# File 'lib/ms_rest_azure/sub_resource.rb', line 48 def validate end |