lib/zakuro/exception/exception.rb in zakuro-0.7.2 vs lib/zakuro/exception/exception.rb in zakuro-0.8.0

- old
+ new

@@ -16,22 +16,24 @@ LOGGER = Output::Logger.new(location: 'exception') # @return [String] 共通メッセージ MESSAGE = 'an error has occurred' - # - # 例外を取得する - # - # @param [Array<Case::Preset>] presets 原因プリセット - # - # @return [ZakuroError] ライブラリエラー - # - def self.get(presets: []) - causes = [] - presets.each do |preset| - causes.push(Cause.new(code: preset.code, message: preset.message)) - end + class << self + # + # 例外を取得する + # + # @param [Array<Case::Preset>] presets 原因プリセット + # + # @return [ZakuroError] ライブラリエラー + # + def get(presets: []) + causes = [] + presets.each do |preset| + causes.push(Cause.new(code: preset.code, message: preset.message)) + end - ZakuroError.new(msg: MESSAGE, causes: causes) + ZakuroError.new(msg: MESSAGE, causes: causes) + end end end end