Ruby 2.4参考手册
Resolv
Resolv::LOC::Size
父类:Object
A Resolv::LOC::Size
常量
正则表达式
属性
scalarR
原始尺寸
公共类方法
创建(arg)显示源
创建一个新的LOC :: Size,arg
其中可以是:
LOC::Size
返回arg
。
字符串
arg
必须匹配LOC :: Size :: Regex常量
# File lib/resolv.rb, line 2627
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
新(标量)显示源
# File lib/resolv.rb, line 2644
def initialize(scalar)
@scalar = scalar
end
Resolv相关

Ruby 是一种面向对象、命令式、函数式、动态的通用编程语言,是世界上最优美而巧妙的语言。
主页 | https://www.ruby-lang.org/ |
源码 | https://github.com/ruby/ruby |
版本 | 2.4 |
发布版本 | 2.4.1 |