Class: Pio::Icmp::Message

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/pio/icmp/message.rb

Overview

Base class of Request, Reply, TTL Exceeded and destination unreachable.

Direct Known Subclasses

Reply, Request

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_options) ⇒ Message

Returns a new instance of Message.



43
44
45
46
# File 'lib/pio/icmp/message.rb', line 43

def initialize(user_options)
  options = self.class.const_get(:Options).new(user_options)
  @frame = Icmp::Format.new(options.to_hash)
end

Class Method Details

.create_from(frame) ⇒ Object



35
36
37
38
39
# File 'lib/pio/icmp/message.rb', line 35

def self.create_from(frame)
  message = allocate
  message.instance_variable_set :@frame, frame
  message
end