123456789_123456789_123456789_123456789_123456789_

Exception: RBS::DuplicatedInterfaceMethodDefinitionError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, DefinitionError, BaseError, StandardError
Instance Chain:
self, DefinitionError, BaseError, StandardError
Inherits: RBS::DefinitionError
Defined in: lib/rbs/errors.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(type:, method_name:, member:) ⇒ DuplicatedInterfaceMethodDefinitionError

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 255

def initialize(type:, method_name:, member:)
  @type = type
  @method_name = method_name
  @member = member

  super "#{member.location}: Duplicated method definition: #{qualified_method_name}"
end

Instance Attribute Details

#member (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 253

attr_reader :member

#method_name (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 252

attr_reader :method_name

#type (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 251

attr_reader :type

Instance Method Details

#qualified_method_name

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 263

def qualified_method_name
  case type
  when Types::ClassSingleton
    "#{type.name}.#{method_name}"
  else
    "#{type.name}##{method_name}"
  end
end

#type_name

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 272

def type_name
  type.name
end