Class: PacketGen::Header::Base::ProcBinding Private

Inherits:
Object
  • Object
show all
Defined in:
lib/packetgen/header/base.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class to handle a header association from procs

Instance Method Summary collapse

Constructor Details

#initialize(procs) ⇒ ProcBinding

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ProcBinding.

Parameters:

  • procs (Array<Proc>)

    first proc is used to set fields, second proc is used to check binding



59
60
61
62
# File 'lib/packetgen/header/base.rb', line 59

def initialize(procs)
  @set = procs.shift
  @check = procs.shift
end

Instance Method Details

#check?(fields) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Check fields responds to binding

Parameters:

Returns:

  • (Boolean)


67
68
69
# File 'lib/packetgen/header/base.rb', line 67

def check?(fields)
  @check.call(fields)
end

#set(fields) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Set fields field to binding value

Parameters:



74
75
76
# File 'lib/packetgen/header/base.rb', line 74

def set(fields)
  @set.call(fields)
end