Class: MOCO::Helpers
- Inherits:
-
Object
- Object
- MOCO::Helpers
- Defined in:
- lib/moco/helpers.rb
Overview
Utility class with helper methods for the MOCO API
Class Method Summary collapse
Class Method Details
.decimal_hours_to_civil(decimal_hours) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/moco/helpers.rb', line 6 def self.decimal_hours_to_civil(decimal_hours) hours = decimal_hours.floor fractional_hours = decimal_hours - hours minutes = (fractional_hours * 60).round "#{hours}:#{format("%02d", minutes)}" end |