Class: Subpacketizer

Inherits:
Object show all
Defined in:
lib/openc3/subpacketizers/subpacketizer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#argsObject (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