Class: Pio::OpenFlow::HelloFailedCode

Inherits:
BinData::Primitive
  • Object
show all
Defined in:
lib/pio/open_flow/hello_failed_code.rb

Overview

enum ofp_hello_failed_code

Constant Summary collapse

ERROR_CODES =
{ incompatible: 0, permissions_error: 1 }.freeze

Instance Method Summary collapse

Instance Method Details

#getObject



14
15
16
# File 'lib/pio/open_flow/hello_failed_code.rb', line 14

def get
  ERROR_CODES.invert.fetch(error_code)
end

#set(value) ⇒ Object



18
19
20
# File 'lib/pio/open_flow/hello_failed_code.rb', line 18

def set(value)
  self.error_code = ERROR_CODES.fetch(value)
end