Method: BitPacker#declare

Defined in:
lib/bit-packer.rb

#declare(&block) ⇒ Object

Receives declaration.

Adds declaration of bit array items. Can be call multiple times. New delcarations are joind to end of the array.

Examples:

packer.declare do
    number (:number) {2}
    boolean :boolean
end

Parameters:

  • block (Proc)

    block with declaration

See Also:



93
94
95
# File 'lib/bit-packer.rb', line 93

def declare(&block)
    self.instance_eval(&block)
end