class RBS::Types::Function::Param
属性
location[R]
name[R]
type[R]
公共类方法
new(type:, name:, location: nil) 点击切换源码
# File rbs-3.8.0/lib/rbs/types.rb, line 884 def initialize(type:, name:, location: nil) @type = type @name = name @location = location end
公共实例方法
==(other) 点击切换源码
# File rbs-3.8.0/lib/rbs/types.rb, line 890 def ==(other) other.is_a?(Param) && other.type == type && other.name == name end
也别名为: eql?
hash() 点击切换源码
# File rbs-3.8.0/lib/rbs/types.rb, line 896 def hash self.class.hash ^ type.hash ^ name.hash end
map_type() { |type| ... } 点击切换源码
# File rbs-3.8.0/lib/rbs/types.rb, line 900 def map_type(&block) if block Param.new(name: name, type: yield(type), location: location) else enum_for :map_type end end
to_json(state = _ = nil) 点击切换源码
# File rbs-3.8.0/lib/rbs/types.rb, line 908 def to_json(state = _ = nil) { type: type, name: name }.to_json(state) end
to_s() 点击切换源码
# File rbs-3.8.0/lib/rbs/types.rb, line 912 def to_s if name if name.match?(/\A[a-zA-Z0-9_]+\z/) "#{type} #{name}" else "#{type} `#{name}`" end else "#{type}" end end