Class: Dreamcatcher::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/dreamcatcher/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/dreamcatcher/configuration.rb', line 8

def initialize
  @exception_class = StandardError
  @from = '[email protected]'
  @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

Instance Attribute Details

#deliverObject

Returns the value of attribute deliver.



3
4
5
# File 'lib/dreamcatcher/configuration.rb', line 3

def deliver
  @deliver
end

#exception_classObject

Returns the value of attribute exception_class.



3
4
5
# File 'lib/dreamcatcher/configuration.rb', line 3

def exception_class
  @exception_class
end

#fromObject

Returns the value of attribute from.



3
4
5
# File 'lib/dreamcatcher/configuration.rb', line 3

def from
  @from
end

#subjectObject

Returns the value of attribute subject.



3
4
5
# File 'lib/dreamcatcher/configuration.rb', line 3

def subject
  @subject
end

#templateObject

Returns the value of attribute template.



3
4
5
# File 'lib/dreamcatcher/configuration.rb', line 3

def template
  @template
end

#template_dirObject

Returns the value of attribute template_dir.



3
4
5
# File 'lib/dreamcatcher/configuration.rb', line 3

def template_dir
  @template_dir
end

#toObject

Returns the value of attribute to.



3
4
5
# File 'lib/dreamcatcher/configuration.rb', line 3

def to
  @to
end

#viaObject

Returns the value of attribute via.



3
4
5
# File 'lib/dreamcatcher/configuration.rb', line 3

def via
  @via
end

#via_optionsObject

Returns the value of attribute via_options.



3
4
5
# File 'lib/dreamcatcher/configuration.rb', line 3

def via_options
  @via_options
end

Instance Method Details

#evaluate(symbol, *args) ⇒ Object



23
24
25
26
# File 'lib/dreamcatcher/configuration.rb', line 23

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