Sha256: 5fccebb8630be90511667e33b464ab48133149108c48e33dab6d07140b95e618

Contents?: true

Size: 387 Bytes

Versions: 19

Compression:

Stored size: 387 Bytes

Contents

require 'bindata'
require 'ipaddr'

module Pio
  module Type
    # IPv6 address
    class Ipv6Address < BinData::Primitive
      endian :big

      uint128 :ipv6_address

      def set(value)
        self.ipv6_address = IPAddr.new(value, Socket::Constants::AF_INET6)
      end

      def get
        IPAddr.new(ipv6_address, Socket::Constants::AF_INET6).to_s
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
pio-0.30.1 lib/pio/type/ipv6_address.rb
pio-0.30.0 lib/pio/type/ipv6_address.rb
pio-0.29.0 lib/pio/type/ipv6_address.rb
pio-0.28.1 lib/pio/type/ipv6_address.rb
pio-0.28.0 lib/pio/type/ipv6_address.rb
pio-0.27.2 lib/pio/type/ipv6_address.rb
pio-0.27.1 lib/pio/type/ipv6_address.rb
pio-0.27.0 lib/pio/type/ipv6_address.rb
pio-0.26.0 lib/pio/type/ipv6_address.rb
pio-0.25.0 lib/pio/type/ipv6_address.rb
pio-0.24.2 lib/pio/type/ipv6_address.rb
pio-0.24.1 lib/pio/type/ipv6_address.rb
pio-0.24.0 lib/pio/type/ipv6_address.rb
pio-0.23.1 lib/pio/type/ipv6_address.rb
pio-0.23.0 lib/pio/type/ipv6_address.rb
pio-0.22.0 lib/pio/type/ipv6_address.rb
pio-0.21.1 lib/pio/type/ipv6_address.rb
pio-0.21.0 lib/pio/type/ipv6_address.rb
pio-0.20.1 lib/pio/type/ipv6_address.rb