Class: Fluent::TextParser::NetflowParser::MacAddr

Inherits:
BinData::Primitive
  • Object
show all
Defined in:
lib/fluent/plugin/parser_netflow.rb

Instance Method Summary collapse

Instance Method Details

#getObject



280
281
282
# File 'lib/fluent/plugin/parser_netflow.rb', line 280

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

#set(val) ⇒ Object



275
276
277
278
# File 'lib/fluent/plugin/parser_netflow.rb', line 275

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