class Pio::Type::EtherType

Ether type

Public Instance Methods

get() click to toggle source
# File lib/pio/type/ether_type.rb, line 17
def get
  ether_type
end
inspect() click to toggle source
# File lib/pio/type/ether_type.rb, line 28
def inspect
  Kernel.format '0x%04x', self
end
set(value) click to toggle source
# File lib/pio/type/ether_type.rb, line 13
def set(value)
  self.ether_type = value
end
to_bytes() click to toggle source

This method smells of :reek:UncommunicativeVariableName

# File lib/pio/type/ether_type.rb, line 22
def to_bytes
  byte1 = format('%02x', (self & 0xff00) >> 8)
  byte2 = format('%02x', self & 0xff)
  "0x#{byte1}, 0x#{byte2}"
end