Class: Array

Inherits:
Object show all
Defined in:
lib/jeweler/utils/core_ext/Array.rb

Instance Method Summary collapse

Instance Method Details

#build_errorsObject



12
13
14
15
16
# File 'lib/jeweler/utils/core_ext/Array.rb', line 12

def build_errors
  each do |e|
    @errors << e
  end
end

#log_errors(prefix_msg = nil) ⇒ Object

Logs all of these errors, as errors, prefixed with the param (optionally)



3
4
5
6
7
8
9
10
11
# File 'lib/jeweler/utils/core_ext/Array.rb', line 3

def log_errors(prefix_msg = nil)
  each do |e|
    if prefix_msg.nil?
      Rails.logger.error e
    else
      Rails.logger.error prefix_msg + ': ' + e
    end
  end
end