Class: OctetArray

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

Instance Method Summary collapse

Instance Method Details

#getObject



136
137
138
# File 'lib/logstash/codecs/netflow/util.rb', line 136

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

#set(val) ⇒ Object



132
133
134
# File 'lib/logstash/codecs/netflow/util.rb', line 132

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