class RBS::Types::Literal
常量
- TABLE
属性
literal[R]
location[R]
公共类方法
new(literal:, location:) 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1487 def initialize(literal:, location:) @literal = literal @location = location end
unescape_string(string, is_double_quote) 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1543 def self.unescape_string(string, is_double_quote) if is_double_quote string.gsub!(/\\([0-9]{1,3})/) { ($1 || "").to_i(8).chr } string.gsub!(/\\x([0-9a-f]{1,2})/) { ($1 || "").to_i(16).chr } string.gsub!(/\\u([0-9a-fA-F]{4})/) { ($1 || "").to_i(16).chr(Encoding::UTF_8) } string.gsub!(/\\[abefnrstv"'\\]?/, TABLE) string else string.gsub!(/\\['\\]/, TABLE) string end end
公共实例方法
==(other) 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1492 def ==(other) other.is_a?(Literal) && other.literal == literal end
也别名为: eql?
has_classish_type?() 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1519 def has_classish_type? false end
has_self_type?() 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1515 def has_self_type? false end
hash() 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1498 def hash self.class.hash ^ literal.hash end
to_json(state = _ = nil) 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1507 def to_json(state = _ = nil) { class: :literal, literal: literal.inspect, location: location }.to_json(state) end
to_s(level = 0) 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1511 def to_s(level = 0) literal.inspect end
with_nonreturn_void?() 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1523 def with_nonreturn_void? false end