Method: Cosmos::UnixTimeConversion#to_s

Defined in:
lib/cosmos/conversions/unix_time_conversion.rb

#to_sString

Returns The name of the class followed by the time conversion.

Returns:

  • (String)

    The name of the class followed by the time conversion



48
49
50
51
52
53
54
# File 'lib/cosmos/conversions/unix_time_conversion.rb', line 48

def to_s
  if @microseconds_item_name
    return "Time.at(packet.read('#{@seconds_item_name}', :RAW, buffer), packet.read('#{@microseconds_item_name}', :RAW, buffer)).sys"
  else
    return "Time.at(packet.read('#{@seconds_item_name}', :RAW, buffer), 0).sys"
  end
end