Module: InstanceConfigurationHelper

Defined in:
app/helpers/instance_configuration_helper.rb

Instance Method Summary collapse

Instance Method Details

#instance_configuration_cell_html(value, &block) ⇒ Object



4
5
6
7
8
# File 'app/helpers/instance_configuration_helper.rb', line 4

def instance_configuration_cell_html(value, &block)
  return '-' unless value.to_s.presence

  block ? yield(value) : value
end

#instance_configuration_disabled_cell_html(value) ⇒ Object



21
22
23
# File 'app/helpers/instance_configuration_helper.rb', line 21

def instance_configuration_disabled_cell_html(value)
  instance_configuration_cell_html(value == 0 ? nil : value)
end

#instance_configuration_host(host) ⇒ Object



10
11
12
# File 'app/helpers/instance_configuration_helper.rb', line 10

def instance_configuration_host(host)
  @instance_configuration_host ||= instance_configuration_cell_html(host).capitalize
end

#instance_configuration_human_size_cell(value) ⇒ Object

Value must be in bytes



15
16
17
18
19
# File 'app/helpers/instance_configuration_helper.rb', line 15

def instance_configuration_human_size_cell(value)
  instance_configuration_cell_html(value) do |v|
    number_to_human_size(v, strip_insignificant_zeros: true, significant: false)
  end
end