Exception: Rubysierung::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Rubysierung::Error
- Defined in:
- lib/rubysierung/error.rb
Defined Under Namespace
Class Method Summary collapse
-
.set_data(_self:, name:, method_object:, file:, line:) ⇒ void
sets @__error_data on provided obj pointer.
Instance Method Summary collapse
- #initialize(error_data) ⇒ void constructor
-
#message ⇒ String
Error message.
-
#raise_child(strict) ⇒ Rubysierung::Error::Standard|Rubysierung::Error::Strict
Instance of one of the two classes.
Constructor Details
#initialize(error_data) ⇒ void
5 6 7 |
# File 'lib/rubysierung/error.rb', line 5 def initialize(error_data) @error_data = error_data end |
Class Method Details
.set_data(_self:, name:, method_object:, file:, line:) ⇒ void
This method returns an undefined value.
sets @__error_data on provided obj pointer
32 33 34 35 36 37 38 39 |
# File 'lib/rubysierung/error.rb', line 32 def self.set_data(_self:, name:, method_object:, file:, line:) err_data = _self.instance_variable_get :@__error_data err_data[:method_object] = method_object err_data[:method_file] = file err_data[:method_name] = name err_data[:method_line] = line _self.instance_variable_set :@__error_data, err_data end |
Instance Method Details
#message ⇒ String
TODO:
refactor into idependend methods and assemble them inside message
Returns error message.
21 22 23 |
# File 'lib/rubysierung/error.rb', line 21 def "Class:#{@error_data[:klass]}, Conversion Method:#{@error_data[:type]}, Method:#{@error_data[:method_object]}:#{@error_data[:method_file]} #{@error_data[:method_name]}:#{@error_data[:method_line]} -- called on #{@error_data[:caller]} with #{@error_data[:var_sym]}:#{@error_data[:value]} of #{@error_data[:value_class]} doesn't respond to #{@error_data[:type]}" end |
#raise_child(strict) ⇒ Rubysierung::Error::Standard|Rubysierung::Error::Strict
Returns instance of one of the two classes.
11 12 13 14 15 16 17 |
# File 'lib/rubysierung/error.rb', line 11 def raise_child(strict) if strict == 0 Rubysierung::Error::Standard.new(@error_data) else Rubysierung::Error::Strict.new(@error_data) end end |