Class: Artifactory::GemImport::Gem::Errors
- Inherits:
-
Object
- Object
- Artifactory::GemImport::Gem::Errors
- Defined in:
- lib/artifactory/gem_import/gem/errors.rb
Instance Method Summary collapse
- #add(key, msg) ⇒ Object
- #any? ⇒ Boolean
- #full_message(key) ⇒ Object
- #full_messages ⇒ Object
-
#initialize ⇒ Errors
constructor
A new instance of Errors.
- #on(key) ⇒ Object
Constructor Details
#initialize ⇒ Errors
Returns a new instance of Errors.
5 6 7 |
# File 'lib/artifactory/gem_import/gem/errors.rb', line 5 def initialize @errors = Hash.new { |h, k| h[k] = [] } end |
Instance Method Details
#add(key, msg) ⇒ Object
9 10 11 12 |
# File 'lib/artifactory/gem_import/gem/errors.rb', line 9 def add(key, msg) @errors[key] << msg self end |
#any? ⇒ Boolean
14 15 16 |
# File 'lib/artifactory/gem_import/gem/errors.rb', line 14 def any? @errors.values.flatten.any? end |
#full_message(key) ⇒ Object
29 30 31 |
# File 'lib/artifactory/gem_import/gem/errors.rb', line 29 def (key) @errors[key].join(", ") end |
#full_messages ⇒ Object
22 23 24 25 26 27 |
# File 'lib/artifactory/gem_import/gem/errors.rb', line 22 def @errors .keys .map { |key| [key, (key)].join(": ") } .join("; ") end |
#on(key) ⇒ Object
18 19 20 |
# File 'lib/artifactory/gem_import/gem/errors.rb', line 18 def on(key) @errors[key] end |