Sha256: a5a64d2f9d9561bbd7db544e3bcb3c0f17b5e8b67be704642c7621befbde81eb

Contents?: true

Size: 492 Bytes

Versions: 2

Compression:

Stored size: 492 Bytes

Contents

# encoding: utf-8
module DutyCalculator
  class Dootie < StandardError
    def initialize(data=nil)
      @data = data
      @default_message = "[DutyCalculator][Error]: ¯\\_(ツ)_/¯"
    end

    def to_s
      msg = []
      msg << @data[:message] || @default_message
      msg << "Error Code: #{@data[:error][:code]}"
      msg << DutyCalculator::ErrorMessages.for_code(@data[:error][:code]) if @data[:error][:code]
      msg.to_s
    end
  end

  class NotImplemented < Dootie; end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
duty_calculator-0.0.8 lib/duty_calculator/dootie.rb
duty_calculator-0.0.7 lib/duty_calculator/dootie.rb