File: common.rb

package info (click to toggle)
zonecheck 2.0.4-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,416 kB
  • ctags: 1,177
  • sloc: ruby: 9,582; xml: 731; sh: 404; makefile: 71
file content (38 lines) | stat: -rw-r--r-- 800 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# $Id: common.rb,v 1.3 2003/04/03 17:11:43 sdalu Exp $

# 
# AUTHOR   : Stephane D'Alu <sdalu@nic.fr>
# CREATED  : 2002/07/19 07:28:13
#
# COPYRIGHT: AFNIC (c) 2003
# LICENSE  : RUBY
# CONTACT  : 
#
# $Revision: 1.3 $ 
# $Date: 2003/04/03 17:11:43 $
#
# INSPIRED BY:
#   - the ruby file: resolv.rb 
#
# CONTRIBUTORS: (see also CREDITS file)
#
#


##
## Basic definition of an address
##
class Address
    class InvalidAddress < ArgumentError
    end

    attr_reader :address

    def namespace   ; ""                              ; end
    def to_name     ; to_dnsform + "." + namespace    ; end

    def inspect     ; "#<#{self.class} #{self.to_s}>" ; end
    def hash        ; @address.hash                   ; end
    def eql?(other) ; @address == other.address       ; end
    alias == eql?
end