Class: Pio::OpenFlow::OpenFlowHeader::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/pio/open_flow/open_flow_header.rb

Overview

parse header options

Class Method Summary collapse

Class Method Details

.parse(options) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/pio/open_flow/open_flow_header.rb', line 34

def self.parse(options)
  xid = if options.respond_to?(:to_i)
          options.to_i
        elsif options.respond_to?(:fetch)
          options[:transaction_id] || options[:xid] || 0
        else
          fail TypeError
        end
  { transaction_id: xid }
end