Sha256: ef0098599a87d2d2014f06d1d89c22426c99aa32d25e694b233793ebe62b59ed

Contents?: true

Size: 568 Bytes

Versions: 12

Compression:

Stored size: 568 Bytes

Contents

module Lev

  class Error

    attr_accessor :code
    attr_accessor :data
    attr_accessor :kind
    attr_accessor :message

    # The inputs related to this error
    attr_accessor :offending_inputs

    def initialize(args={})
      raise IllegalArgument, "must supply a :code" if args[:code].blank?

      self.code = args[:code]
      self.data = args[:data]
      self.kind = args[:kind]
      self.message = args[:message]
      self.offending_inputs = args[:offending_inputs]
    end

    def translate
      ErrorTranslator.translate(self)
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lev-2.2.2 lib/lev/error.rb
lev-2.2.1 lib/lev/error.rb
lev-2.2.0 lib/lev/error.rb
lev-2.1.1 lib/lev/error.rb
lev-2.1.0 lib/lev/error.rb
lev-2.0.5 lib/lev/error.rb
lev-2.0.4 lib/lev/error.rb
lev-2.0.3 lib/lev/error.rb
lev-2.0.2 lib/lev/error.rb
lev-2.0.1 lib/lev/error.rb
lev-1.0.1 lib/lev/error.rb
lev-1.0.0 lib/lev/error.rb