Sha256: f2861847cdbb7733ea07442339ed51f855171770b75124dc13e1bbb5ec8fe693
Contents?: true
Size: 720 Bytes
Versions: 1
Compression:
Stored size: 720 Bytes
Contents
# encoding: utf-8 module Loaf #:nodoc: # Default Loaf error for all custom errors. # class LoafError < StandardError BASE_KEY = "loaf.errors" def error_message(key, attributes) translate(key, attributes) end def translate(key, options) ::I18n.translate("#{BASE_KEY}.#{key}", { :locale => :en }.merge(options)) end end # Raised when invalid options are passed to breadcrumbs view renderer. # InvalidOptions.new :name, :crumber, [:crumb] # class InvalidOptions < LoafError def initialize(invalid, valid) super( error_message("invalid_options", { :invalid => invalid, :valid => valid.join(', ') } ) ) end end end # Loaf
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
loaf-0.5.0 | lib/loaf/errors.rb |