Class: Unified2::Constructor::Primitive::IPV4

Inherits:
BinData::Primitive
  • Object
show all
Defined in:
lib/unified2/constructor/primitive/ipv4.rb

Overview

BinData Primitive IP4 Constructor

Instance Method Summary collapse

Instance Method Details

#getObject

IPV4#get



30
31
32
# File 'lib/unified2/constructor/primitive/ipv4.rb', line 30

def get
  self.octets.collect { |octet| "%d" % octet }.join(".")
end

#set(value) ⇒ Object

IPV4#set



24
25
26
27
# File 'lib/unified2/constructor/primitive/ipv4.rb', line 24

def set(value)
  ints = value.split(/\./).collect { |int| int.to_i }
  self.octets = ints
end