Class: Gloo::Core::Error
- Inherits:
-
Object
- Object
- Gloo::Core::Error
- Defined in:
- lib/gloo/core/error.rb
Instance Attribute Summary collapse
-
#error_count ⇒ Object
Returns the value of attribute error_count.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#clear ⇒ Object
Clear out the error message.
-
#clear_if_no_errors ⇒ Object
Clear out error if we didn’t add any new ones.
-
#initialize ⇒ Error
constructor
Set up the error object.
-
#is_function? ⇒ Boolean
Is this a function object?.
-
#set_to(new_value) ⇒ Object
Set the value of error.
-
#start_tracking ⇒ Object
Start counting errors.
-
#to_s ⇒ Object
Get the string representation of the error.
Constructor Details
#initialize ⇒ Error
Set up the error object.
16 17 18 |
# File 'lib/gloo/core/error.rb', line 16 def initialize clear end |
Instance Attribute Details
#error_count ⇒ Object
Returns the value of attribute error_count.
11 12 13 |
# File 'lib/gloo/core/error.rb', line 11 def error_count @error_count end |
#value ⇒ Object
Returns the value of attribute value.
11 12 13 |
# File 'lib/gloo/core/error.rb', line 11 def value @value end |
Instance Method Details
#clear ⇒ Object
Clear out the error message.
23 24 25 26 |
# File 'lib/gloo/core/error.rb', line 23 def clear @error_count = 0 @value = nil end |
#clear_if_no_errors ⇒ Object
Clear out error if we didn’t add any new ones.
48 49 50 |
# File 'lib/gloo/core/error.rb', line 48 def clear_if_no_errors self.clear if @error_count.zero? end |
#is_function? ⇒ Boolean
Is this a function object?
62 63 64 |
# File 'lib/gloo/core/error.rb', line 62 def is_function? return false end |
#set_to(new_value) ⇒ Object
Set the value of error.
31 32 33 34 |
# File 'lib/gloo/core/error.rb', line 31 def set_to( new_value ) @error_count += 1 @value = new_value end |
#start_tracking ⇒ Object
Start counting errors. We’re looking to see if we get any new ones during a script or an immediate command.
41 42 43 |
# File 'lib/gloo/core/error.rb', line 41 def start_tracking @error_count = 0 end |
#to_s ⇒ Object
Get the string representation of the error.
55 56 57 |
# File 'lib/gloo/core/error.rb', line 55 def to_s return @value.to_s end |