Module: BanditHelper

Defined in:
lib/generators/bandit/templates/dashboard/helpers/bandit_helper.rb

Instance Method Summary collapse

Instance Method Details

#player_configObject



19
20
21
22
# File 'lib/generators/bandit/templates/dashboard/helpers/bandit_helper.rb', line 19

def player_config
  c = Bandit.config.player_config.map { |k,v| "#{k}: #{v}" }.join(", ")
  c.blank? ? "" : "(#{c})"
end

#player_nameObject



10
11
12
# File 'lib/generators/bandit/templates/dashboard/helpers/bandit_helper.rb', line 10

def player_name
  Bandit.config.player.titleize
end

#round_percent(percent) ⇒ Object



6
7
8
# File 'lib/generators/bandit/templates/dashboard/helpers/bandit_helper.rb', line 6

def round_percent(percent)
  (percent * 100).round / 100.0
end

#storage_configObject



14
15
16
17
# File 'lib/generators/bandit/templates/dashboard/helpers/bandit_helper.rb', line 14

def storage_config
  c = Bandit.config.storage_config.map { |k,v| "#{k}: #{v}" }.join(", ")
  c.blank? ? "" : "(#{c})"
end

#storage_nameObject



2
3
4
# File 'lib/generators/bandit/templates/dashboard/helpers/bandit_helper.rb', line 2

def storage_name
  Bandit.config.storage.titleize
end