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.



217
218
219
220
221
222
223
# File 'lib/rbs/errors.rb', line 217

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.



215
216
217
# File 'lib/rbs/errors.rb', line 215

def member
  @member
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



214
215
216
# File 'lib/rbs/errors.rb', line 214

def method_name
  @method_name
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#qualified_method_nameObject



225
226
227
228
229
230
231
232
# File 'lib/rbs/errors.rb', line 225

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