Exception: RBS::UnknownMethodAliasError

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_name:, aliased_name:, location:) ⇒ UnknownMethodAliasError

Returns a new instance of UnknownMethodAliasError.



243
244
245
246
247
248
249
# File 'lib/rbs/errors.rb', line 243

def initialize(original_name:, aliased_name:, location:)
  @original_name = original_name
  @aliased_name = aliased_name
  @location = location

  super "#{Location.to_string location}: Unknown method alias name: #{original_name} => #{aliased_name}"
end

Instance Attribute Details

#aliased_nameObject (readonly)

Returns the value of attribute aliased_name.



240
241
242
# File 'lib/rbs/errors.rb', line 240

def aliased_name
  @aliased_name
end

#locationObject (readonly)

Returns the value of attribute location.



241
242
243
# File 'lib/rbs/errors.rb', line 241

def location
  @location
end

#original_nameObject (readonly)

Returns the value of attribute original_name.



239
240
241
# File 'lib/rbs/errors.rb', line 239

def original_name
  @original_name
end

Class Method Details

.check!(methods:, original_name:, aliased_name:, location:) ⇒ Object



251
252
253
254
255
# File 'lib/rbs/errors.rb', line 251

def self.check!(methods:, original_name:, aliased_name:, location:)
  unless methods.key?(original_name)
    raise new(original_name: original_name, aliased_name: aliased_name, location: location)
  end
end