class RBS::Definition::Method::TypeDef
属性
annotations[R]
defined_in[R]
implemented_in[R]
member[R]
member_annotations[R]
overload_annotations[R]
type[R]
公共类方法
new(type:, member:, defined_in:, implemented_in:, overload_annotations: []) 点击以切换源代码
# File rbs-3.8.0/lib/rbs/definition.rb, line 35 def initialize(type:, member:, defined_in:, implemented_in:, overload_annotations: []) @type = type @member = member @defined_in = defined_in @implemented_in = implemented_in @member_annotations = member.annotations @overload_annotations = overload_annotations @annotations = member.annotations + overload_annotations end
公共实例方法
==(other) 点击以切换源代码
# File rbs-3.8.0/lib/rbs/definition.rb, line 45 def ==(other) other.is_a?(TypeDef) && other.type == type && other.member == member && other.defined_in == defined_in && other.implemented_in == implemented_in end
也别名为:eql?
comment() 点击以切换源代码
# File rbs-3.8.0/lib/rbs/definition.rb, line 59 def comment member.comment end
hash() 点击以切换源代码
# File rbs-3.8.0/lib/rbs/definition.rb, line 55 def hash self.class.hash ^ type.hash ^ member.hash ^ defined_in.hash ^ implemented_in.hash end
overload?() 点击以切换源代码
# File rbs-3.8.0/lib/rbs/definition.rb, line 67 def overload? case mem = member when AST::Members::MethodDefinition mem.overloading? else false end end
update(type: self.type, member: self.member, defined_in: self.defined_in, implemented_in: self.implemented_in) 点击以切换源代码
# File rbs-3.8.0/lib/rbs/definition.rb, line 63 def update(type: self.type, member: self.member, defined_in: self.defined_in, implemented_in: self.implemented_in) TypeDef.new(type: type, member: member, defined_in: defined_in, implemented_in: implemented_in, overload_annotations: overload_annotations) end