Exception: RBS::DuplicatedInterfaceMethodDefinitionError
- Inherits:
-
DefinitionError
- Object
- StandardError
- BaseError
- DefinitionError
- RBS::DuplicatedInterfaceMethodDefinitionError
- Includes:
- DetailedMessageable
- 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.
- #location ⇒ Object
- #qualified_method_name ⇒ Object
- #type_name ⇒ Object
Methods included from DetailedMessageable
Constructor Details
#initialize(type:, method_name:, member:) ⇒ DuplicatedInterfaceMethodDefinitionError
Returns a new instance of DuplicatedInterfaceMethodDefinitionError.
299 300 301 302 303 304 305 |
# File 'lib/rbs/errors.rb', line 299 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.
297 298 299 |
# File 'lib/rbs/errors.rb', line 297 def member @member end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
296 297 298 |
# File 'lib/rbs/errors.rb', line 296 def method_name @method_name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
295 296 297 |
# File 'lib/rbs/errors.rb', line 295 def type @type end |
Instance Method Details
#location ⇒ Object
307 308 309 |
# File 'lib/rbs/errors.rb', line 307 def location member.location end |
#qualified_method_name ⇒ Object
311 312 313 314 315 316 317 318 |
# File 'lib/rbs/errors.rb', line 311 def qualified_method_name case type when Types::ClassSingleton "#{type.name}.#{method_name}" else "#{type.name}##{method_name}" end end |
#type_name ⇒ Object
320 321 322 |
# File 'lib/rbs/errors.rb', line 320 def type_name type.name end |