Sha256: 726855b8dc2869dd5d4ccc6f75a2b1a51998a55f9ef788819724e8573c5bf417

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

module Net # :nodoc:
  module DNS
    class RR

      #------------------------------------------------------------
      # RR type NULL
      #------------------------------------------------------------
      class NULL < RR
        attr_reader :null

        private

        def build_pack
          @null_pack = @null
          @rdlength = @null_pack.size
        end

        def get_data
          @null_pack
        end

        def get_inspect
          "#@null"
        end

        def subclass_new_from_hash(args)
          if args.has_key? :null
            @null = args[:null]
          else
            raise ArgumentError, ":null field is mandatory but missing"
          end
        end

        def subclass_new_from_string(str)
          @null = str.strip
        end

        def subclass_new_from_binary(data,offset)
          @null = data[offset..offset+@rdlength]
          return offset + @rdlength
        end

        private

          def set_type
            @type = Net::DNS::RR::Types.new("NULL")
          end

      end

    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
net-dns2-0.8.7 lib/net/dns/rr/null.rb
net-dns2-0.8.6 lib/net/dns/rr/null.rb
net-dns2-0.8.5 lib/net/dns/rr/null.rb
net-dns2-0.8.4 lib/net/dns/rr/null.rb
net-dns2-0.8.3 lib/net/dns/rr/null.rb
net-dns2-0.8.2 lib/net/dns/rr/null.rb
net-dns2-0.8.1 lib/net/dns/rr/null.rb
net-dns-0.8.0 lib/net/dns/rr/null.rb
net-dns-0.7.1 lib/net/dns/rr/null.rb
net-dns-0.7.0 lib/net/dns/rr/null.rb