Exception: RBS::InvalidTypeApplicationError
- Inherits:
-
DefinitionError
- Object
- StandardError
- BaseError
- DefinitionError
- RBS::InvalidTypeApplicationError
- Defined in:
- lib/rbs/errors.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type_name:, args:, params:, location:) ⇒ InvalidTypeApplicationError
constructor
A new instance of InvalidTypeApplicationError.
Constructor Details
#initialize(type_name:, args:, params:, location:) ⇒ InvalidTypeApplicationError
Returns a new instance of InvalidTypeApplicationError.
87 88 89 90 91 92 93 |
# File 'lib/rbs/errors.rb', line 87 def initialize(type_name:, args:, params:, location:) @type_name = type_name @args = args @params = params @location = location super "#{Location.to_string location}: #{type_name} expects parameters [#{params.join(", ")}], but given args [#{args.join(", ")}]" end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
83 84 85 |
# File 'lib/rbs/errors.rb', line 83 def args @args end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
85 86 87 |
# File 'lib/rbs/errors.rb', line 85 def location @location end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
84 85 86 |
# File 'lib/rbs/errors.rb', line 84 def params @params end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
82 83 84 |
# File 'lib/rbs/errors.rb', line 82 def type_name @type_name end |
Class Method Details
.check!(type_name:, args:, params:, location:) ⇒ Object
95 96 97 98 99 |
# File 'lib/rbs/errors.rb', line 95 def self.check!(type_name:, args:, params:, location:) unless args.size == params.size raise new(type_name: type_name, args: args, params: params, location: location) end end |