Sha256: feb0ec86815c3aca7dae33a8a5ea84025cab27363a137c8c10e48493f482dbdf

Contents?: true

Size: 866 Bytes

Versions: 6

Compression:

Stored size: 866 Bytes

Contents

module Fog
  module Resources
    class AzureRM
      # Dependency model class
      class Dependency < Fog::Model
        attribute :id
        attribute :resource_name
        attribute :resource_type
        attribute :depends_on

        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
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 lib/fog/azurerm/models/resources/dependency.rb
fog-azure-rm-0.1.0 lib/fog/azurerm/models/resources/dependency.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/models/resources/dependency.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/models/resources/dependency.rb
fog-azure-rm-0.0.6 lib/fog/azurerm/models/resources/dependency.rb
fog-azure-rm-0.0.5 lib/fog/azurerm/models/resources/dependency.rb