Sha256: 73af95df6660d7ea632036417e2a1daf39c63777a94f32e34ed134cdf4c3098a
Contents?: true
Size: 884 Bytes
Versions: 3
Compression:
Stored size: 884 Bytes
Contents
# frozen_string_literal: true require 'truemail/version' require 'truemail/core' require 'truemail/configuration' require 'truemail/validator' module Truemail INCOMPLETE_CONFIG = 'verifier_email is required parameter' NOT_CONFIGURED = 'use Truemail.configure before' class << self def configuration @configuration ||= begin return unless block_given? configuration = Truemail::Configuration.new yield(configuration) raise ConfigurationError, INCOMPLETE_CONFIG unless configuration.complete? configuration end end def configure(&block) configuration(&block) end def reset_configuration! @configuration = nil end def validate(email, **options) raise ConfigurationError, NOT_CONFIGURED unless configuration Truemail::Validator.new(email, **options).run end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
truemail-0.1.3 | lib/truemail.rb |
truemail-0.1.2 | lib/truemail.rb |
truemail-0.1.1.3 | lib/truemail.rb |