Class: I18n::Coverage::Reporter
- Inherits:
-
Object
- Object
- I18n::Coverage::Reporter
- Defined in:
- lib/i18n/coverage/reporter.rb
Class Method Summary collapse
Instance Method Summary collapse
- #hash_report ⇒ Object
-
#initialize ⇒ Reporter
constructor
A new instance of Reporter.
- #report ⇒ Object
Constructor Details
#initialize ⇒ Reporter
Returns a new instance of Reporter.
11 12 13 14 |
# File 'lib/i18n/coverage/reporter.rb', line 11 def initialize @existing_keys = KeyLister.list_keys @stored_keys = KeyLogger.stored_keys end |
Class Method Details
Instance Method Details
#hash_report ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/i18n/coverage/reporter.rb', line 20 def hash_report used_keys = @existing_keys - unused_keys percentage_used = (used_keys.count.to_f / @existing_keys.count) * 100 { key_count: @existing_keys.count, used_key_count: used_keys.count, percentage_used: percentage_used, unused_keys: unused_keys.to_a } end |