Sha256: 615fe640dc8443b1932a74ff9267e4024374e779786862fef5a8a73d638bb069
Contents?: true
Size: 643 Bytes
Versions: 16
Compression:
Stored size: 643 Bytes
Contents
require "i18n" module Shamu # A generic error class for problems in the shamu library. class Error < StandardError private def translation_scope [ :shamu, :errors ] end def translate( key, **args ) I18n.translate key, args.merge( scope: translation_scope ) end end # The resource was not found. class NotFoundError < Error def initialize( message = :not_found ) super translate( message ) end end # The method is not implemented. class NotImplementedError < Error def initialize( message = :not_implemented ) super translate( message ) end end end
Version data entries
16 entries across 16 versions & 1 rubygems