Class: MsRestAzure::Serialization::Serialization

Inherits:
MsRest::Serialization::Serialization
  • Object
show all
Defined in:
lib/ms_rest_azure/serialization.rb

Overview

Class to handle serialization & deserialization.

Instance Method Summary collapse

Instance Method Details

#get_model(model_name) ⇒ Object

Retrieves model of the model_name

Parameters:

  • model_name (String)

    Name of the model to retrieve.



32
33
34
35
36
37
38
39
# File 'lib/ms_rest_azure/serialization.rb', line 32

def get_model(model_name)
  begin
    Object.const_get(@context.class.to_s.split('::')[0...-1].join('::') + "::Models::#{model_name}")
  rescue NameError
    # Look into MsRestAzure namespace if model name not found in the ARM's models namespace
    Object.const_get("MsRestAzure::#{model_name}")
  end
end