Method: StructFx#add

Defined in:
lib/struct-fx.rb

#add(name, type, callback = nil, block = nil) ⇒ Object

Adds declaration.

Parameters:

  • name (Symbol)

    name of the entry

  • type (Symbol)

    type of the entry

  • callback (Proc) (defaults to: nil)

    postprocessing callback

  • block (Proc) (defaults to: nil)

    length declaration block



222
223
224
225
226
# File 'lib/struct-fx.rb', line 222

def add(name, type, callback = nil, block = nil)
    @stack << [name, type, callback, block]
    @struct = nil
    @compiled = nil
end