Class: SflowMacAddress

Inherits:
BinData::Primitive
  • Object
show all
Defined in:
lib/logstash/codecs/sflow/util.rb

Overview

noinspection RubyResolve

Instance Method Summary collapse

Instance Method Details

#getObject



15
16
17
# File 'lib/logstash/codecs/sflow/util.rb', line 15

def get
  self.bytes.collect { |byte| byte.value.to_s(16).rjust(2, '0') }.join(':')
end

#set(val) ⇒ Object



10
11
12
13
# File 'lib/logstash/codecs/sflow/util.rb', line 10

def set(val)
  ints = val.split(/:/).collect { |int| int.to_i(16) }
  self.bytes = ints
end