Sha256: c3ab7d7f3b708b7c5e89448c0538a99f58c40a86e6007f363a945714a519fb59

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

module Net
  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 # class NULL
      
    end # class RR
  end # module DNS
end # module Net

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
net-dns-0.6.1 lib/net/dns/rr/null.rb
net-dns-0.6.0 lib/net/dns/rr/null.rb