Class: Bundler::Alive::StatusResult
- Inherits:
-
Object
- Object
- Bundler::Alive::StatusResult
- Defined in:
- lib/bundler/alive/status_result.rb
Overview
Represents Result of Status
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#error_messages ⇒ Object
readonly
Returns the value of attribute error_messages.
-
#rate_limit_exceeded ⇒ Object
readonly
Returns the value of attribute rate_limit_exceeded.
Instance Method Summary collapse
-
#initialize(collection: StatusCollection.new, error_messages: [], rate_limit_exceeded: false) ⇒ StatusResult
constructor
Creates a new StatusResult instance.
-
#merge(result) ⇒ StatusResult
Merge
StatusResult
, then returns new one.
Constructor Details
#initialize(collection: StatusCollection.new, error_messages: [], rate_limit_exceeded: false) ⇒ StatusResult
Creates a new StatusResult instance
20 21 22 23 24 25 26 |
# File 'lib/bundler/alive/status_result.rb', line 20 def initialize(collection: StatusCollection.new, error_messages: [], rate_limit_exceeded: false) @collection = collection @error_messages = @rate_limit_exceeded = rate_limit_exceeded freeze end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
9 10 11 |
# File 'lib/bundler/alive/status_result.rb', line 9 def collection @collection end |
#error_messages ⇒ Object (readonly)
Returns the value of attribute error_messages.
9 10 11 |
# File 'lib/bundler/alive/status_result.rb', line 9 def @error_messages end |
#rate_limit_exceeded ⇒ Object (readonly)
Returns the value of attribute rate_limit_exceeded.
9 10 11 |
# File 'lib/bundler/alive/status_result.rb', line 9 def rate_limit_exceeded @rate_limit_exceeded end |
Instance Method Details
#merge(result) ⇒ StatusResult
Merge StatusResult
, then returns new one
35 36 37 38 39 40 41 42 |
# File 'lib/bundler/alive/status_result.rb', line 35 def merge(result) merged_collection = collection.merge(result.collection) = + result. merged_rate_limit_exceeded = rate_limit_exceeded || result.rate_limit_exceeded self.class.new(collection: merged_collection, error_messages: , rate_limit_exceeded: merged_rate_limit_exceeded) end |