module LIFX::LAN::Seen

Public Instance Methods

last_seen() click to toggle source

Returns the time when the device was last seen. @return [Time]

# File lib/lifx/lan/seen.rb, line 6
def last_seen
  @last_seen
end
seconds_since_seen() click to toggle source

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]

# File lib/lifx/lan/seen.rb, line 14
def seconds_since_seen
  Time.now - (last_seen || Time.at(0))
end
seen!() click to toggle source

Marks the device as being seen. @private

# File lib/lifx/lan/seen.rb, line 20
def seen!
  @last_seen = Time.now
end