Class: OpenC3::ReceivedTimeFormattedConversion
- Inherits:
-
Conversion
- Object
- Conversion
- OpenC3::ReceivedTimeFormattedConversion
- Defined in:
- lib/openc3/conversions/received_time_formatted_conversion.rb
Overview
Converts the packet received time object into a formatted string.
Instance Attribute Summary
Attributes inherited from Conversion
#converted_array_size, #converted_bit_size, #converted_type
Instance Method Summary collapse
-
#call(value, packet, buffer) ⇒ String
Formatted packet time.
-
#initialize ⇒ ReceivedTimeFormattedConversion
constructor
Initializes converted_type to :STRING and converted_bit_size to 0.
Methods inherited from Conversion
Constructor Details
#initialize ⇒ ReceivedTimeFormattedConversion
Initializes converted_type to :STRING and converted_bit_size to 0
29 30 31 32 33 |
# File 'lib/openc3/conversions/received_time_formatted_conversion.rb', line 29 def initialize super() @converted_type = :STRING @converted_bit_size = 0 end |
Instance Method Details
#call(value, packet, buffer) ⇒ String
Returns Formatted packet time.
37 38 39 40 41 42 43 |
# File 'lib/openc3/conversions/received_time_formatted_conversion.rb', line 37 def call(value, packet, buffer) if packet.received_time return packet.received_time.formatted else return 'No Packet Received Time' end end |