Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/internet_time.rb
Constant Summary collapse
- BMT_OFFSET_SEC =
Biel Mean Time offset to UTC in seconds
3600
Instance Method Summary collapse
-
#beats ⇒ Object
Time in .beats.
-
#bmt ⇒ Object
Time in Biel Mean Time (UTC+1).
-
#to_beats ⇒ Object
Time in .beats, formatted.
Instance Method Details
#beats ⇒ Object
Time in .beats
22 23 24 25 |
# File 'lib/internet_time.rb', line 22 def beats time = bmt ((time.hour * 60 + time.min) * 60 + time.sec) * 10 / 864 end |
#bmt ⇒ Object
Time in Biel Mean Time (UTC+1)
17 18 19 |
# File 'lib/internet_time.rb', line 17 def bmt utc + BMT_OFFSET_SEC end |
#to_beats ⇒ Object
Time in .beats, formatted
28 29 30 |
# File 'lib/internet_time.rb', line 28 def to_beats '@%03d' % beats end |