Class: Unified2::Constructor::Primitive::IPV4
- Inherits:
-
BinData::Primitive
- Object
- BinData::Primitive
- Unified2::Constructor::Primitive::IPV4
- Defined in:
- lib/unified2/constructor/primitive/ipv4.rb
Overview
BinData Primitive IP4 Constructor
Instance Method Summary collapse
-
#get ⇒ Object
IPV4#get.
-
#set(value) ⇒ Object
IPV4#set.
Instance Method Details
#get ⇒ Object
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 |