Class: IP4Addr
- Inherits:
-
BinData::Primitive
- Object
- BinData::Primitive
- IP4Addr
- Defined in:
- lib/logstash/codecs/sflow/util.rb
Instance Method Summary collapse
Instance Method Details
#get ⇒ Object
31 32 33 |
# File 'lib/logstash/codecs/sflow/util.rb', line 31 def get IPAddr.new_ntoh([self.storage].pack('N')).to_s end |
#set(val) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/logstash/codecs/sflow/util.rb', line 23 def set(val) ip = IPAddr.new(val) if !ip.ipv4? raise ArgumentError, "invalid IPv4 address '#{val}'" end self.storage = ip.to_i end |