Class: RedisClient::Cluster::ErrorCollection
- Defined in:
- lib/redis_client/cluster/errors.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(error_message = nil) ⇒ ErrorCollection
constructor
A new instance of ErrorCollection.
- #with_errors(errors) ⇒ Object
Methods inherited from Error
Constructor Details
#initialize(error_message = nil) ⇒ ErrorCollection
Returns a new instance of ErrorCollection.
51 52 53 54 |
# File 'lib/redis_client/cluster/errors.rb', line 51 def initialize( = nil) @errors = nil super end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
40 41 42 |
# File 'lib/redis_client/cluster/errors.rb', line 40 def errors @errors end |
Class Method Details
.with_errors(errors) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/redis_client/cluster/errors.rb', line 42 def self.with_errors(errors) if !errors.is_a?(Hash) || errors.empty? new(errors.to_s).with_errors(EMPTY_HASH) else = errors.map { |node_key, error| "#{node_key}: (#{error.class}) #{error.}" }.freeze new(.join(', ')).with_errors(errors) end end |
Instance Method Details
#with_errors(errors) ⇒ Object
56 57 58 59 |
# File 'lib/redis_client/cluster/errors.rb', line 56 def with_errors(errors) @errors = errors if @errors.nil? self end |