Class: OctetArray

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

Instance Method Summary collapse

Instance Method Details

#getObject



334
335
336
# File 'lib/logstash/codecs/netflow/util.rb', line 334

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

#set(val) ⇒ Object



328
329
330
331
332
# File 'lib/logstash/codecs/netflow/util.rb', line 328

def set(val)
  unless val.nil?
    self.bytes = val.scan(/../).collect { |hex| hex.to_i(16)}
  end
end