Class: Packet::Callback

Inherits:
Object
  • Object
show all
Defined in:
lib/packet/packet_callback.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Callback

Returns a new instance of Callback.



5
6
7
8
# File 'lib/packet/packet_callback.rb', line 5

def initialize(&block)
  @signature = Guid.hexdigest
  @stored_proc = block
end

Instance Attribute Details

#signatureObject

Returns the value of attribute signature.



4
5
6
# File 'lib/packet/packet_callback.rb', line 4

def signature
  @signature
end

#stored_procObject

Returns the value of attribute stored_proc.



4
5
6
# File 'lib/packet/packet_callback.rb', line 4

def stored_proc
  @stored_proc
end

Instance Method Details

#invoke(*args) ⇒ Object



10
11
12
# File 'lib/packet/packet_callback.rb', line 10

def invoke(*args)
  @stored_proc.call(*args)
end