class Gem::Resolv::LOC::Size
常量
- Regex
属性
scalar[R]
原始大小
公共类方法
create(arg) 点击切换源代码
从 arg 创建一个新的 LOC::Size,arg 可以是
LOC::Size-
返回
arg。 - 字符串
-
arg必须匹配 LOC::Size::Regex 常量
# File rubygems/vendor/resolv/lib/resolv.rb, line 3233 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
new(scalar) 点击切换源代码
# File rubygems/vendor/resolv/lib/resolv.rb, line 3250 def initialize(scalar) @scalar = scalar end