Class: Fog::Resources::AzureRM::ResourceGroups

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

Instance Method Summary collapse

Instance Method Details

#allObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fog/azurerm/models/resources/resource_groups.rb', line 10

def all
  resource_groups = []
  service.list_resource_groups.each do |rg|
    hash = {}
    rg.instance_variables.each do |var|
      hash[var.to_s.delete('@')] = rg.instance_variable_get(var)
    end
    resource_groups << hash
  end
  load(resource_groups)
end

#get(identity) ⇒ Object



22
23
24
# File 'lib/fog/azurerm/models/resources/resource_groups.rb', line 22

def get(identity)
  all.find { |f| f.name == identity }
end