Class: Fog::Resources::AzureRM::Dependency

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/azurerm/models/resources/dependency.rb

Overview

Dependency model class

Class Method Summary collapse

Class Method Details

.parse(dependency) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fog/azurerm/models/resources/dependency.rb', line 11

def self.parse(dependency)
  hash = {}
  hash['id'] = dependency.id
  hash['resource_name'] = dependency.resource_name
  hash['resource_type'] = dependency.resource_type

  hash['depends_on'] = []
  dependency.depends_on.each do |sub_dependency|
    dependency_obj = Fog::Resources::AzureRM::Dependency.new
    hash['depends_on'] << dependency_obj.merge_attributes(Fog::Resources::AzureRM::Dependency.parse(sub_dependency))
  end if dependency.respond_to?('depends_on')
  hash
end