Exception: RBS::DuplicatedInterfaceMethodDefinitionError
- Inherits:
-
DefinitionError
- Object
- StandardError
- ErrorBase
- DefinitionError
- RBS::DuplicatedInterfaceMethodDefinitionError
- Defined in:
- lib/rbs/errors.rb
Instance Attribute Summary collapse
-
#member ⇒ Object
readonly
Returns the value of attribute member.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, method_name:, member:) ⇒ DuplicatedInterfaceMethodDefinitionError
constructor
A new instance of DuplicatedInterfaceMethodDefinitionError.
- #qualified_method_name ⇒ Object
- #type_name ⇒ Object
Constructor Details
#initialize(type:, method_name:, member:) ⇒ DuplicatedInterfaceMethodDefinitionError
Returns a new instance of DuplicatedInterfaceMethodDefinitionError.
226 227 228 229 230 231 232 |
# File 'lib/rbs/errors.rb', line 226 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 ⇒ Object (readonly)
Returns the value of attribute member.
224 225 226 |
# File 'lib/rbs/errors.rb', line 224 def member @member end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
223 224 225 |
# File 'lib/rbs/errors.rb', line 223 def method_name @method_name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
222 223 224 |
# File 'lib/rbs/errors.rb', line 222 def type @type end |
Instance Method Details
#qualified_method_name ⇒ Object
234 235 236 237 238 239 240 241 |
# File 'lib/rbs/errors.rb', line 234 def qualified_method_name case type when Types::ClassSingleton "#{type.name}.#{method_name}" else "#{type.name}##{method_name}" end end |
#type_name ⇒ Object
243 244 245 |
# File 'lib/rbs/errors.rb', line 243 def type_name type.name end |