Class: HumanistErrors::Search
- Inherits:
-
Object
- Object
- HumanistErrors::Search
- Defined in:
- lib/humanist_errors/search.rb
Instance Attribute Summary collapse
-
#error_object ⇒ Object
Returns the value of attribute error_object.
-
#found_error ⇒ Object
Returns the value of attribute found_error.
-
#ruby_error_message ⇒ Object
Returns the value of attribute ruby_error_message.
Class Method Summary collapse
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(error_object, ruby_error_message) ⇒ Search
constructor
A new instance of Search.
Constructor Details
#initialize(error_object, ruby_error_message) ⇒ Search
Returns a new instance of Search.
12 13 14 15 |
# File 'lib/humanist_errors/search.rb', line 12 def initialize(error_object, ) @error_object = error_object @ruby_error_message = end |
Instance Attribute Details
#error_object ⇒ Object
Returns the value of attribute error_object.
4 5 6 |
# File 'lib/humanist_errors/search.rb', line 4 def error_object @error_object end |
#found_error ⇒ Object
Returns the value of attribute found_error.
3 4 5 |
# File 'lib/humanist_errors/search.rb', line 3 def found_error @found_error end |
#ruby_error_message ⇒ Object
Returns the value of attribute ruby_error_message.
4 5 6 |
# File 'lib/humanist_errors/search.rb', line 4 def @ruby_error_message end |
Class Method Details
.run(error_object, ruby_error_message) ⇒ Object
6 7 8 9 10 |
# File 'lib/humanist_errors/search.rb', line 6 def self.run(error_object, ) searcher = new(error_object, ) searcher.found_error = searcher.find searcher end |
Instance Method Details
#find ⇒ Object
17 18 19 20 21 |
# File 'lib/humanist_errors/search.rb', line 17 def find error = keyify(error_object) return :no_result unless ERROR_MAPPER.keys.include?(error) ERROR_MAPPER[error][] end |