Class: Fog::Hetznercloud::Compute::Datacenter

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/hetznercloud/models/compute/datacenter.rb

Instance Method Summary collapse

Instance Method Details

#location=(value) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/fog/hetznercloud/models/compute/datacenter.rb', line 13

def location=(value)
  attributes[:location] = case value
                          when Hash
                            service.locations.new(value)
                          when String
                            service.locations.all(name: value).first
                          when Integer
                            service.locations.get(value)
                          else
                            value
                          end
end