Class: Ruleby::Core::NetworkBucket

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeNetworkBucket

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

#counterObject (readonly)

Returns the value of attribute counter.



969
970
971
# File 'lib/core/nodes.rb', line 969

def counter
  @counter
end

#errorsObject (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_errorsObject



988
989
990
# File 'lib/core/nodes.rb', line 988

def clear_errors
  @errors = []
end

#increment_counterObject



976
977
978
# File 'lib/core/nodes.rb', line 976

def increment_counter
  @counter += 1
end

#reset_counterObject



980
981
982
# File 'lib/core/nodes.rb', line 980

def reset_counter
  @counter = 0
end