Exception: RBS::InvalidExtensionParameterError
- Inherits:
-
StandardError
- Object
- StandardError
- RBS::InvalidExtensionParameterError
- Defined in:
- lib/rbs/errors.rb
Instance Attribute Summary collapse
-
#class_params ⇒ Object
readonly
Returns the value of attribute class_params.
-
#extension_name ⇒ Object
readonly
Returns the value of attribute extension_name.
-
#extension_params ⇒ Object
readonly
Returns the value of attribute extension_params.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type_name:, extension_name:, extension_params:, class_params:, location:) ⇒ InvalidExtensionParameterError
constructor
A new instance of InvalidExtensionParameterError.
Constructor Details
#initialize(type_name:, extension_name:, extension_params:, class_params:, location:) ⇒ InvalidExtensionParameterError
Returns a new instance of InvalidExtensionParameterError.
45 46 47 48 49 50 51 52 53 |
# File 'lib/rbs/errors.rb', line 45 def initialize(type_name:, extension_name:, extension_params:, class_params:, location:) @type_name = type_name @extension_name = extension_name @extension_params = extension_params @class_params = class_params @location = location super "#{Location.to_string location}: Expected #{class_params.size} parameters to #{type_name} (#{extension_name}) but has #{extension_params.size} parameters" end |
Instance Attribute Details
#class_params ⇒ Object (readonly)
Returns the value of attribute class_params.
43 44 45 |
# File 'lib/rbs/errors.rb', line 43 def class_params @class_params end |
#extension_name ⇒ Object (readonly)
Returns the value of attribute extension_name.
40 41 42 |
# File 'lib/rbs/errors.rb', line 40 def extension_name @extension_name end |
#extension_params ⇒ Object (readonly)
Returns the value of attribute extension_params.
42 43 44 |
# File 'lib/rbs/errors.rb', line 42 def extension_params @extension_params end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
41 42 43 |
# File 'lib/rbs/errors.rb', line 41 def location @location end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
39 40 41 |
# File 'lib/rbs/errors.rb', line 39 def type_name @type_name end |
Class Method Details
.check!(type_name:, extension_name:, extension_params:, class_params:, location:) ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/rbs/errors.rb', line 55 def self.check!(type_name:, extension_name:, extension_params:, class_params:, location:) unless extension_params.size == class_params.size raise new(type_name: type_name, extension_name: extension_name, extension_params: extension_params, class_params: class_params, location: location) end end |