Sha256: 14278508bc4731af11f209017fc61902510b0b433a958199129dba76a9d87893

Contents?: true

Size: 603 Bytes

Versions: 9

Compression:

Stored size: 603 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 ArgumentError, "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

    def to_s
      inspect
    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
lev-7.0.0 lib/lev/error.rb
lev-6.0.0 lib/lev/error.rb
lev-5.0.0 lib/lev/error.rb
lev-4.3.2 lib/lev/error.rb
lev-4.3.1 lib/lev/error.rb
lev-4.3.0 lib/lev/error.rb
lev-4.2.0 lib/lev/error.rb
lev-4.1.0 lib/lev/error.rb
lev-4.0.0 lib/lev/error.rb