Class: Shugoi::RateLimitFormatter
- Inherits:
-
Object
- Object
- Shugoi::RateLimitFormatter
- Defined in:
- lib/shugoi/rate_limit_formatter.rb
Class Method Summary collapse
Class Method Details
.remaining(seconds) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/shugoi/rate_limit_formatter.rb', line 3 def self.remaining(seconds) minutes = seconds / 60 seconds_part = seconds % 60 if minutes.positive? "#{minutes} min#{'s' if minutes > 1}#{" #{seconds_part} s" if seconds_part.positive?}" else "#{seconds_part} seconde#{'s' if seconds_part > 1}" end end |