Module: FogExtensions::Xenserver::Host

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/fog_extensions/xenserver/host.rb

Instance Method Summary collapse

Instance Method Details

#initialize(new_attributes = {}) ⇒ Object



11
12
13
14
# File 'app/models/concerns/fog_extensions/xenserver/host.rb', line 11

def initialize(new_attributes = {})
  super(new_attributes)
  attributes[:display_name] = "#{name} - #{mem_free_gb} GB free memory"
end

#mem_free_gbObject



16
17
18
19
20
# File 'app/models/concerns/fog_extensions/xenserver/host.rb', line 16

def mem_free_gb
  return metrics.memory_free.to_i / 1024 / 1024 / 1024 if metrics

  0
end