Exception: Uinit::Sig::ParameterTypeError
- Inherits:
-
StandardError
- Object
- StandardError
- Uinit::Sig::ParameterTypeError
- Defined in:
- lib/uinit/sig/parameter_type_error.rb
Instance Attribute Summary collapse
-
#parameter ⇒ Object
readonly
Returns the value of attribute parameter.
-
#type_error ⇒ Object
readonly
Returns the value of attribute type_error.
Instance Method Summary collapse
-
#initialize(parameter, type_error) ⇒ ParameterTypeError
constructor
A new instance of ParameterTypeError.
- #message ⇒ Object
Constructor Details
#initialize(parameter, type_error) ⇒ ParameterTypeError
Returns a new instance of ParameterTypeError.
6 7 8 9 10 11 12 13 |
# File 'lib/uinit/sig/parameter_type_error.rb', line 6 def initialize(parameter, type_error) super() @parameter = parameter @type_error = type_error set_backtrace(type_error.backtrace) end |
Instance Attribute Details
#parameter ⇒ Object (readonly)
Returns the value of attribute parameter.
15 16 17 |
# File 'lib/uinit/sig/parameter_type_error.rb', line 15 def parameter @parameter end |
#type_error ⇒ Object (readonly)
Returns the value of attribute type_error.
15 16 17 |
# File 'lib/uinit/sig/parameter_type_error.rb', line 15 def type_error @type_error end |
Instance Method Details
#message ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/uinit/sig/parameter_type_error.rb', line 17 def method = parameter.method file, line = method.method_origin.source_location "Type error on parameter '#{parameter.name}' " \ "in method '#{method.method_name}' at '#{file}:#{line}', detail:\n#{type_error.message}" end |