Module: EGauge

Defined in:
lib/egauge/register.rb,
lib/egauge.rb,
lib/egauge/data.rb

Overview

Represents a single register in the

Defined Under Namespace

Classes: Data, Register

Class Method Summary collapse

Class Method Details

.parse_time(str) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/egauge.rb', line 12

def self.parse_time(str)
  # Chop off the initial hex flagging if present
  str = str[2..-1] if str[/^0x/]
  # Do ruby stuff to convert to 4 byte unsigned int
  as_int = str.hex
  # And return as a time...
  Time.at(as_int).utc
end