Sha256: f7c80b309516846b054954c3bc107cf02318d96c8d32c50c1a4fe2beb830e3b0
Contents?: true
Size: 888 Bytes
Versions: 2
Compression:
Stored size: 888 Bytes
Contents
require "kharon/version" require "kharon/validator" require "kharon/helpers/validate" require "kharon/configuration" require "kharon/errors/validation" require "kharon/handlers/exceptions" require "kharon/handlers/messages" module Kharon # Configuration method used to tell the module if it uses exceptions or stores error messages. # @param [Boolean] use TRUE if you want to use exceptions, FALSE else. def self.use_exceptions(use = true) Kharon::Configuration.instance.use_exceptions(use) end # Returns the current error handler, defined by if you use exceptions or not. # @return [Object] an instance of Kharon::Handlers::Exceptions if you use exceptions, an instance of Kharon::Handlers::Messages else. def self.errors_handler Kharon::Configuration.instance.uses_exceptions? ? Kharon::Handlers::Exceptions.instance : Kharon::Handlers::Messages.new end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
kharon-0.5.1 | lib/kharon.rb |
kharon-0.5.0 | lib/kharon.rb |