Module: BanditHelper
- Defined in:
- lib/generators/bandit/templates/dashboard/helpers/bandit_helper.rb
Instance Method Summary collapse
- #player_config ⇒ Object
- #player_name ⇒ Object
- #round_percent(percent) ⇒ Object
- #storage_config ⇒ Object
- #storage_name ⇒ Object
Instance Method Details
#player_config ⇒ Object
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_name ⇒ Object
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 |