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-2.1.0/lib/rbs/definition.rb, line 30
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-2.1.0/lib/rbs/definition.rb, line 37
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-2.1.0/lib/rbs/definition.rb, line 55
def annotations
  member.annotations
end
comment() click to toggle source
# File rbs-2.1.0/lib/rbs/definition.rb, line 51
def comment
  member.comment
end
eql?(other)
Alias for: ==
hash() click to toggle source
# File rbs-2.1.0/lib/rbs/definition.rb, line 47
def hash
  self.class.hash ^ type.hash ^ member.hash ^ defined_in.hash ^ implemented_in.hash
end
overload?() click to toggle source
# File rbs-2.1.0/lib/rbs/definition.rb, line 63
def overload?
  case mem = member
  when AST::Members::MethodDefinition
    mem.overload?
  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-2.1.0/lib/rbs/definition.rb, line 59
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