Class: Pio::Icmp::Message

Inherits:
Message
  • Object
show all
Extended by:
ClassInspector
Includes:
Pio::InstanceInspector
Defined in:
lib/pio/icmp/message.rb

Overview

Base class of Icmp::Request and Icmp::Reply.

Direct Known Subclasses

Request

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ClassInspector

inspect

Methods included from Pio::InstanceInspector

#inspect

Methods inherited from Message

option

Methods included from RubyDumper

#to_ruby

Constructor Details

#initialize(user_options) ⇒ Message

Returns a new instance of Message.



26
27
28
# File 'lib/pio/icmp/message.rb', line 26

def initialize(user_options)
  @format = Icmp::Format.new(parse_options(user_options))
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



30
31
32
# File 'lib/pio/icmp/message.rb', line 30

def method_missing(method, *args)
  @format.__send__(method, *args)
end

Class Method Details

.create(format) ⇒ Object



20
21
22
23
24
# File 'lib/pio/icmp/message.rb', line 20

def self.create(format)
  allocate.tap do |message|
    message.instance_variable_set :@format, format
  end
end

.fieldsObject



16
17
18
# File 'lib/pio/icmp/message.rb', line 16

def self.fields
  Icmp::Format.fields
end