Class: Subpacketizer
- Defined in:
- lib/openc3/subpacketizers/subpacketizer.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Instance Method Summary collapse
- #as_json(*a) ⇒ Object
-
#call(packet) ⇒ Object
Subclass and implement this method to break packet into array of subpackets Subpackets should be fully identified and defined.
-
#initialize(packet = nil) ⇒ Subpacketizer
constructor
A new instance of Subpacketizer.
Constructor Details
#initialize(packet = nil) ⇒ Subpacketizer
Returns a new instance of Subpacketizer.
4 5 6 7 |
# File 'lib/openc3/subpacketizers/subpacketizer.rb', line 4 def initialize(packet=nil) @packet = packet @args = [] end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
2 3 4 |
# File 'lib/openc3/subpacketizers/subpacketizer.rb', line 2 def args @args end |
Instance Method Details
#as_json(*a) ⇒ Object
15 16 17 |
# File 'lib/openc3/subpacketizers/subpacketizer.rb', line 15 def as_json(*a) { 'class' => self.class.name, 'args' => @args.as_json(*a) } end |
#call(packet) ⇒ Object
Subclass and implement this method to break packet into array of subpackets Subpackets should be fully identified and defined
11 12 13 |
# File 'lib/openc3/subpacketizers/subpacketizer.rb', line 11 def call(packet) return [packet] end |