Sha256: 0cae90fe44e684cfff4bd3e56f13580e02961b9c3d4f9d135fa1ee1781a88633

Contents?: true

Size: 719 Bytes

Versions: 2

Compression:

Stored size: 719 Bytes

Contents

class Dreamcatcher::Configuration

  attr_accessor :exception_class, 
                :to, :from, :subject, 
                :deliver, :via, :via_options, 
                :template, :template_dir

  def initialize
    @exception_class = StandardError
    @from = 'exceptions@example.com'
    @subject = lambda do |context|
      "Exception #{context.exception.class.name}: #{context.exception.message}"
    end

    @template_dir = Dreamcatcher::TEMPLATE_DIR
    @template     = 'generic_exception'
    
    @via          = :sendmail
    @via_options  = nil
    @deliver      = false
  end

  def evaluate(symbol, *args)
    value = self.send(symbol)
    value.respond_to?(:call) ? value.call(*args) : value
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dreamcatcher-0.0.2 lib/dreamcatcher/configuration.rb
dreamcatcher-0.0.1 lib/dreamcatcher/configuration.rb