Class: Pio::Enqueue

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

Overview

An action to enqueue the packet on the specified queue attached to a port.

Defined Under Namespace

Classes: Format

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_options) ⇒ Enqueue

Returns a new instance of Enqueue.



36
37
38
39
40
# File 'lib/pio/enqueue.rb', line 36

def initialize(user_options)
  validate_port_number user_options
  validate_queue_id user_options
  @format = Format.new(user_options)
end

Class Method Details

.read(raw_data) ⇒ Object



22
23
24
25
26
# File 'lib/pio/enqueue.rb', line 22

def self.read(raw_data)
  enqueue = allocate
  enqueue.instance_variable_set :@format, Format.read(raw_data)
  enqueue
end