Module: LiveF1::Packet::Decryptable
- Included in:
- Car::BestLapTime, Car::Driver, Car::Gap, Car::Interval, Car::LapCount, Car::LapTime, Car::NumPits, Car::Number, Car::Period1, Car::Period2, Car::Period3, Car::PitCount, Car::PitLap1, Car::PitLap2, Car::PitLap3, Car::Position, Car::PositionHistory, Car::Sector1, Car::Sector2, Car::Sector3, Sys::Commentary, Sys::Notice, Sys::Speed, Sys::Timestamp, Sys::TrackStatus, Sys::Weather
- Defined in:
- lib/live_f1/packet/decryptable.rb
Overview
Packets which mixin the Decryptable module represent data that is encrypted in the data stream.
When setting the packet data we transparently decrypt the data, and also set a raw_data containing the original, encrypted bytes in case they are useful
Instance Attribute Summary collapse
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
Instance Method Summary collapse
Instance Attribute Details
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
10 11 12 |
# File 'lib/live_f1/packet/decryptable.rb', line 10 def raw_data @raw_data end |
Instance Method Details
#bytes ⇒ Object
17 18 19 |
# File 'lib/live_f1/packet/decryptable.rb', line 17 def bytes @raw_data end |
#data=(bytes) ⇒ Object
12 13 14 15 |
# File 'lib/live_f1/packet/decryptable.rb', line 12 def data= bytes @raw_data = bytes @data = source.decrypt(bytes) end |