Exception: RBS::DuplicatedInterfaceMethodDefinitionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rbs/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, method_name:, member:) ⇒ DuplicatedInterfaceMethodDefinitionError

Returns a new instance of DuplicatedInterfaceMethodDefinitionError.



214
215
216
217
218
219
220
# File 'lib/rbs/errors.rb', line 214

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

#memberObject (readonly)

Returns the value of attribute member.



212
213
214
# File 'lib/rbs/errors.rb', line 212

def member
  @member
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



211
212
213
# File 'lib/rbs/errors.rb', line 211

def method_name
  @method_name
end

#typeObject (readonly)

Returns the value of attribute type.



210
211
212
# File 'lib/rbs/errors.rb', line 210

def type
  @type
end

Instance Method Details

#qualified_method_nameObject



222
223
224
225
226
227
228
229
# File 'lib/rbs/errors.rb', line 222

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