Class: Fog::Hyperv::Compute::Switches

Inherits:
Fog::Hyperv::Collection show all
Defined in:
lib/fog/hyperv/compute/models/switches.rb

Instance Method Summary collapse

Methods inherited from Fog::Hyperv::Collection

#all, get_method, #initialize, #new, requires, requires?

Constructor Details

This class inherits a constructor from Fog::Hyperv::Collection

Instance Method Details

#get(identifier, **filter) ⇒ Object

Raises:

  • (ArgumentError)


11
12
13
14
15
16
17
18
# File 'lib/fog/hyperv/compute/models/switches.rb', line 11

def get(identifier, **filter)
  id = identifier if identifier =~ /\A#{Fog::Hyperv::GUID}\z/i
  name = identifier unless id

  raise ArgumentError, 'Must provide a name or GUID' if (id.nil? || id.empty?) && (name.nil? || name.empty?)

  super(name:, id:, **filter)
end