Module: ExceptionTransformer

Defined in:
lib/exception_transformer.rb,
lib/exception_transformer/version.rb,
lib/exception_transformer/reportable.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods, Reportable, ReportableException Classes: Config, Transformer

Constant Summary collapse

VERSION =
"1.0.4"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config.



12
13
14
# File 'lib/exception_transformer.rb', line 12

def config
  @config
end

Class Method Details

.configObject



28
29
30
# File 'lib/exception_transformer.rb', line 28

def self.config
  @config ||= Config.new
end

.configure {|config| ... } ⇒ Object

To send exceptions to a crash reporter, implement a configuration block:

Examples:

ExceptionTransformer.configure do |config|
  config.reporter = proc { |e| Raven.capture_exception(e) }
end

Yields:



24
25
26
# File 'lib/exception_transformer.rb', line 24

def self.configure
  yield config if block_given?
end

.included(base) ⇒ Object



14
15
16
17
# File 'lib/exception_transformer.rb', line 14

def self.included base
  base.send :include, InstanceMethods
  base.extend ClassMethods
end