Class: Pio::Arp::Message

Inherits:
Message show all
Defined in:
lib/pio/arp/message.rb

Overview

Base class of ARP Request and Reply

Direct Known Subclasses

Request

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Message

option

Methods included from RubyDumper

#to_ruby

Constructor Details

#initialize(user_options) ⇒ Message

Returns a new instance of Message.



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

def initialize(user_options)
  @format = Arp::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



20
21
22
# File 'lib/pio/arp/message.rb', line 20

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

Class Method Details

.create(format) ⇒ Object



10
11
12
13
14
# File 'lib/pio/arp/message.rb', line 10

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