Parent class for Prefix32 and Prefix128
IPAddress::Prefix is the parent class for IPAddress::Prefix32 and IPAddress::Prefix128, defining some modules in common for both the subclasses.
IPAddress::Prefix shouldn't be accesses directly, unless for particular needs.
Sums two prefixes or a prefix to a number, returns a Fixnum
# File lib/ipaddress/prefix.rb, line 60 def +(oth) if oth.is_a? Fixnum self.prefix + oth else self.prefix + oth.prefix end end
Returns the difference between two prefixes, or a prefix and a number, as a Fixnum
# File lib/ipaddress/prefix.rb, line 73 def -(oth) if oth.is_a? Fixnum self.prefix - oth else (self.prefix - oth.prefix).abs end end
Compare the prefix
# File lib/ipaddress/prefix.rb, line 52 def <=>(oth) @prefix <=> oth.to_i end
Returns the prefix
# File lib/ipaddress/prefix.rb, line 45 def to_i @prefix end
Returns a string with the prefix
# File lib/ipaddress/prefix.rb, line 37 def to_s "#@prefix" end
Generated with the Darkfish Rdoc Generator 2.