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.



70
71
72
73
# File 'lib/packetgen/header/base.rb', line 70

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



78
79
80
# File 'lib/packetgen/header/base.rb', line 78

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



85
86
87
# File 'lib/packetgen/header/base.rb', line 85

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