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.



130
131
132
133
134
135
136
# File 'lib/rbs/errors.rb', line 130

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.



127
128
129
# File 'lib/rbs/errors.rb', line 127

def aliased_name
  @aliased_name
end

#locationObject (readonly)

Returns the value of attribute location.



128
129
130
# File 'lib/rbs/errors.rb', line 128

def location
  @location
end

#original_nameObject (readonly)

Returns the value of attribute original_name.



126
127
128
# File 'lib/rbs/errors.rb', line 126

def original_name
  @original_name
end

Class Method Details

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



138
139
140
141
142
# File 'lib/rbs/errors.rb', line 138

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