class RBS::Definition::Method::TypeDef

Attributes

defined_in[R]
implemented_in[R]
member[R]
type[R]

Public Class Methods

new(type:, member:, defined_in:, implemented_in:) click to toggle source
# File rbs-3.4.4/lib/rbs/definition.rb, line 32
def initialize(type:, member:, defined_in:, implemented_in:)
  @type = type
  @member = member
  @defined_in = defined_in
  @implemented_in = implemented_in
end

Public Instance Methods

==(other) click to toggle source
# File rbs-3.4.4/lib/rbs/definition.rb, line 39
def ==(other)
  other.is_a?(TypeDef) &&
    other.type == type &&
    other.member == member &&
    other.defined_in == defined_in &&
    other.implemented_in == implemented_in
end
Also aliased as: eql?
annotations() click to toggle source
# File rbs-3.4.4/lib/rbs/definition.rb, line 57
def annotations
  member.annotations
end
comment() click to toggle source
# File rbs-3.4.4/lib/rbs/definition.rb, line 53
def comment
  member.comment
end
eql?(other)
Alias for: ==
hash() click to toggle source
# File rbs-3.4.4/lib/rbs/definition.rb, line 49
def hash
  self.class.hash ^ type.hash ^ member.hash ^ defined_in.hash ^ implemented_in.hash
end
overload?() click to toggle source
# File rbs-3.4.4/lib/rbs/definition.rb, line 65
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) click to toggle source
# File rbs-3.4.4/lib/rbs/definition.rb, line 61
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)
end