Class: Ruleby::Core::NetworkBucket
- Inherits:
-
Object
- Object
- Ruleby::Core::NetworkBucket
- Defined in:
- lib/core/nodes.rb
Overview
an instance of this class hangs on to state that is global to the network
Instance Attribute Summary collapse
-
#counter ⇒ Object
readonly
Returns the value of attribute counter.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #add_error(error) ⇒ Object
- #clear_errors ⇒ Object
- #increment_counter ⇒ Object
-
#initialize ⇒ NetworkBucket
constructor
A new instance of NetworkBucket.
- #reset_counter ⇒ Object
Constructor Details
#initialize ⇒ NetworkBucket
Returns a new instance of NetworkBucket.
971 972 973 974 |
# File 'lib/core/nodes.rb', line 971 def initialize clear_errors reset_counter end |
Instance Attribute Details
#counter ⇒ Object (readonly)
Returns the value of attribute counter.
969 970 971 |
# File 'lib/core/nodes.rb', line 969 def counter @counter end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
969 970 971 |
# File 'lib/core/nodes.rb', line 969 def errors @errors end |
Instance Method Details
#add_error(error) ⇒ Object
984 985 986 |
# File 'lib/core/nodes.rb', line 984 def add_error(error) @errors << error end |
#clear_errors ⇒ Object
988 989 990 |
# File 'lib/core/nodes.rb', line 988 def clear_errors @errors = [] end |
#increment_counter ⇒ Object
976 977 978 |
# File 'lib/core/nodes.rb', line 976 def increment_counter @counter += 1 end |
#reset_counter ⇒ Object
980 981 982 |
# File 'lib/core/nodes.rb', line 980 def reset_counter @counter = 0 end |