Method: Cosmos::GenericConversion#call

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

#call(value, packet, buffer) ⇒ Object

Perform the conversion on the value.

Parameters:

  • value (Object)

    The value to convert

  • packet (Packet)

    The packet which contains the value. This can be useful to reach into the packet and use other values in the conversion.

  • buffer (String)

    The packet buffer

Returns:

  • The converted value



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

def call(value, packet, buffer)
  myself = packet # For backwards compatibility
  if true or myself # Remove unused variable warning for myself
    return eval(@code_to_eval)
  end
end