Class: OpenStax::RescueFrom::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/openstax/rescue_from/configuration.rb', line 16

def initialize
  @raise_exceptions = ![false, 'false'].include?(ENV['RAISE_EXCEPTIONS'])
  @raise_background_exceptions = ![false, 'false'].include?(
    ENV['RAISE_BACKGROUND_EXCEPTIONS']
  )

  @app_name = ENV['APP_NAME']
  @contact_name = ENV['EXCEPTION_CONTACT_NAME']

  @notify_exceptions = true
  @notify_proc = ->(proxy, controller) {}
  @notify_background_exceptions = true
  @notify_background_proc = ->(proxy) {}

  @html_error_template_path = 'errors/any'
  @html_error_template_layout_name = 'application'
end

Instance Attribute Details

#app_nameObject

Returns the value of attribute app_name.



5
6
7
# File 'lib/openstax/rescue_from/configuration.rb', line 5

def app_name
  @app_name
end

#contact_nameObject



12
13
14
# File 'lib/openstax/rescue_from/configuration.rb', line 12

def contact_name
  @contact_name || "us"
end

#html_error_template_layout_nameObject

Returns the value of attribute html_error_template_layout_name.



5
6
7
# File 'lib/openstax/rescue_from/configuration.rb', line 5

def html_error_template_layout_name
  @html_error_template_layout_name
end

#html_error_template_pathObject

Returns the value of attribute html_error_template_path.



5
6
7
# File 'lib/openstax/rescue_from/configuration.rb', line 5

def html_error_template_path
  @html_error_template_path
end

#notify_background_exceptionsObject

Returns the value of attribute notify_background_exceptions.



5
6
7
# File 'lib/openstax/rescue_from/configuration.rb', line 5

def notify_background_exceptions
  @notify_background_exceptions
end

#notify_background_procObject

Returns the value of attribute notify_background_proc.



5
6
7
# File 'lib/openstax/rescue_from/configuration.rb', line 5

def notify_background_proc
  @notify_background_proc
end

#notify_exceptionsObject

Returns the value of attribute notify_exceptions.



5
6
7
# File 'lib/openstax/rescue_from/configuration.rb', line 5

def notify_exceptions
  @notify_exceptions
end

#notify_procObject

Returns the value of attribute notify_proc.



5
6
7
# File 'lib/openstax/rescue_from/configuration.rb', line 5

def notify_proc
  @notify_proc
end

#notify_rack_middlewareObject

Returns the value of attribute notify_rack_middleware.



5
6
7
# File 'lib/openstax/rescue_from/configuration.rb', line 5

def notify_rack_middleware
  @notify_rack_middleware
end

#notify_rack_middleware_optionsObject

Returns the value of attribute notify_rack_middleware_options.



5
6
7
# File 'lib/openstax/rescue_from/configuration.rb', line 5

def notify_rack_middleware_options
  @notify_rack_middleware_options
end

#raise_background_exceptionsObject

Returns the value of attribute raise_background_exceptions.



5
6
7
# File 'lib/openstax/rescue_from/configuration.rb', line 5

def raise_background_exceptions
  @raise_background_exceptions
end

#raise_exceptionsObject

Returns the value of attribute raise_exceptions.



5
6
7
# File 'lib/openstax/rescue_from/configuration.rb', line 5

def raise_exceptions
  @raise_exceptions
end