Sha256: 1e6248e831c65a4ff14daa2885f652c5b472e095a4db165e32f9dc0e2fcb7f92
Contents?: true
Size: 523 Bytes
Versions: 10
Compression:
Stored size: 523 Bytes
Contents
module LIFX module Seen # Returns the time when the device was last seen. # @return [Time] def last_seen @last_seen end # Returns the number of seconds since the device was last seen. # If the device hasn't been seen yet, it will use Unix epoch as # the time it was seen. # @return [Float] def seconds_since_seen Time.now - (last_seen || Time.at(0)) end # Marks the device as being seen. # @private def seen! @last_seen = Time.now end end end
Version data entries
10 entries across 10 versions & 1 rubygems