Method: OpenC3::Structure#define_item
- Defined in:
- lib/openc3/packets/structure.rb
#define_item(name, bit_offset, bit_size, data_type, array_size = nil, endianness = @default_endianness, overflow = :ERROR) ⇒ StrutureItem
Define an item in the structure. This creates a new instance of the item_class as given in the constructor and adds it to the items hash. It also resizes the buffer to accomodate the new item.
206 207 208 209 210 |
# File 'lib/openc3/packets/structure.rb', line 206 def define_item(name, bit_offset, bit_size, data_type, array_size = nil, endianness = @default_endianness, overflow = :ERROR) # Create the item item = @item_class.new(name, bit_offset, bit_size, data_type, endianness, array_size, overflow) define(item) end |