Method: Net::SSH::Test::Packet#instantiate!
- Defined in:
- lib/net/ssh/test/packet.rb
#instantiate! ⇒ Object
Instantiates the packets data elements. When the packet was first defined, some elements may not have been fully realized, and were described as Proc objects rather than atomic types. This invokes those Proc objects and replaces them with their returned values. This allows for values like Net::SSH::Test::Channel#remote_id to be used in scripts before the remote_id is known (since it is only known after a channel has been confirmed open).
57 58 59 |
# File 'lib/net/ssh/test/packet.rb', line 57 def instantiate! @data.map! { |i| i.respond_to?(:call) ? i.call : i } end |