class Gem::Resolv::LOC::Size
def self.create(arg)
def self.create(arg) case arg when Size return arg when String scalar = '' if Regex =~ arg scalar = [(($1.to_f*(1e2)).to_i.to_s[0].to_i*(2**4)+(($1.to_f*(1e2)).to_i.to_s.length-1))].pack("C") else raise ArgumentError.new("not a properly formed Size string: " + arg) end return Size.new(scalar) else raise ArgumentError.new("cannot interpret as Size: #{arg.inspect}") end end
def ==(other) # :nodoc:
def ==(other) # :nodoc: return @scalar == other.scalar end
def eql?(other) # :nodoc:
def eql?(other) # :nodoc: return self == other end
def hash # :nodoc:
def hash # :nodoc: return @scalar.hash end
def initialize(scalar)
def initialize(scalar) @scalar = scalar end
def inspect # :nodoc:
def inspect # :nodoc: return "#<#{self.class} #{self}>" end
def to_s # :nodoc:
def to_s # :nodoc: s = @scalar.unpack("H2").join.to_s return ((s[0].to_i)*(10**(s[1].to_i-2))).to_s << "m" end