Module: FitbitClient::Util
- Included in:
- Resources
- Defined in:
- lib/fitbit_client/util.rb
Class Method Summary collapse
- .empty_str?(obj) ⇒ Boolean
-
.iso_date(date) ⇒ Object
Convert a Date object to a iso8601 format String (yyyy-MM-dd).
- .iso_time(time) ⇒ Object
- .iso_time_with_seconds(time) ⇒ Object
Class Method Details
.empty_str?(obj) ⇒ Boolean
5 6 7 |
# File 'lib/fitbit_client/util.rb', line 5 def empty_str?(obj) obj.nil? || obj.empty? end |
.iso_date(date) ⇒ Object
Convert a Date object to a iso8601 format String (yyyy-MM-dd)
10 11 12 |
# File 'lib/fitbit_client/util.rb', line 10 def iso_date(date) date.iso8601 end |
.iso_time(time) ⇒ Object
14 15 16 |
# File 'lib/fitbit_client/util.rb', line 14 def iso_time(time) time.strftime('%H:%M') end |
.iso_time_with_seconds(time) ⇒ Object
18 19 20 |
# File 'lib/fitbit_client/util.rb', line 18 def iso_time_with_seconds(time) time.strftime('%H:%M:%S') end |