Class: Cosmos::PacketTimeFormattedConversion
- Inherits:
 - 
      Conversion
      
        
- Object
 - Conversion
 - Cosmos::PacketTimeFormattedConversion
 
 
- Defined in:
 - lib/cosmos/conversions/packet_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  ⇒ PacketTimeFormattedConversion 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
Initializes converted_type to :STRING and converted_bit_size to 0.
 
Methods inherited from Conversion
Constructor Details
#initialize ⇒ PacketTimeFormattedConversion
Initializes converted_type to :STRING and converted_bit_size to 0
      26 27 28 29 30  | 
    
      # File 'lib/cosmos/conversions/packet_time_formatted_conversion.rb', line 26 def initialize super() @converted_type = :STRING @converted_bit_size = 0 end  | 
  
Instance Method Details
#call(value, packet, buffer) ⇒ String
Returns Formatted packet time.
      34 35 36 37 38 39 40 41  | 
    
      # File 'lib/cosmos/conversions/packet_time_formatted_conversion.rb', line 34 def call(value, packet, buffer) packet_time = packet.packet_time if packet_time return packet_time.formatted else return 'No Packet Time' end end  |