Module: CountingHelper
- Included in:
- Kakimasu::HomeController
- Defined in:
- app/helpers/counting_helper.rb
Instance Method Summary collapse
-
#countKeys(array) ⇒ Object
Counts how much keys there is in key array.
-
#translationPercentage(all_keys, missing_translations) ⇒ Object
Gets translation percentage.
Instance Method Details
#countKeys(array) ⇒ Object
Counts how much keys there is in key array
3 4 5 |
# File 'app/helpers/counting_helper.rb', line 3 def countKeys(array) array.flatten.count - array.count end |
#translationPercentage(all_keys, missing_translations) ⇒ Object
Gets translation percentage
8 9 10 |
# File 'app/helpers/counting_helper.rb', line 8 def translationPercentage(all_keys, missing_translations) ((1 - ( missing_translations.to_f / all_keys )) * 100).round(2) end |