Class: OpenC3::UnixTimeFormattedConversion
- Inherits:
-
UnixTimeConversion
- Object
- Conversion
- UnixTimeConversion
- OpenC3::UnixTimeFormattedConversion
- Defined in:
- lib/openc3/conversions/unix_time_formatted_conversion.rb
Overview
Converts a unix format time: Epoch Jan 1 1970, seconds and microseconds, 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(seconds_item_name, microseconds_item_name = nil) ⇒ UnixTimeFormattedConversion
constructor
Initializes converted_type to :STRING and converted_bit_size to 0.
-
#to_s ⇒ String
The name of the class followed by the time conversion.
Methods inherited from UnixTimeConversion
Methods inherited from Conversion
Constructor Details
#initialize(seconds_item_name, microseconds_item_name = nil) ⇒ UnixTimeFormattedConversion
Initializes converted_type to :STRING and converted_bit_size to 0
35 36 37 38 39 |
# File 'lib/openc3/conversions/unix_time_formatted_conversion.rb', line 35 def initialize(seconds_item_name, microseconds_item_name = nil) super(seconds_item_name, microseconds_item_name) @converted_type = :STRING @converted_bit_size = 0 end |
Instance Method Details
#call(value, packet, buffer) ⇒ String
Returns Formatted packet time.
43 44 45 |
# File 'lib/openc3/conversions/unix_time_formatted_conversion.rb', line 43 def call(value, packet, buffer) super.formatted end |
#to_s ⇒ String
Returns The name of the class followed by the time conversion.
48 49 50 |
# File 'lib/openc3/conversions/unix_time_formatted_conversion.rb', line 48 def to_s super << ".formatted" end |