Class: OpenStax::RescueFrom::ExceptionOptions
- Inherits:
-
Object
- Object
- OpenStax::RescueFrom::ExceptionOptions
- Defined in:
- lib/openstax/rescue_from/exception_options.rb
Instance Attribute Summary collapse
-
#extras ⇒ Object
Returns the value of attribute extras.
-
#message ⇒ Object
Returns the value of attribute message.
-
#notify ⇒ Object
Returns the value of attribute notify.
-
#sorry ⇒ Object
Returns the value of attribute sorry.
-
#status_code ⇒ Object
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ExceptionOptions
constructor
A new instance of ExceptionOptions.
- #notify? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ ExceptionOptions
Returns a new instance of ExceptionOptions.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/openstax/rescue_from/exception_options.rb', line 6 def initialize( = {}) .stringify_keys! = { 'notify' => true, 'status' => :internal_server_error, 'message' => nil, 'sorry' => true, 'extras' => ->(exception) { {} } }.merge() @notify = ['notify'] @status_code = ['status'] @message = ['message'] @sorry = ['sorry'] @extras = ['extras'] end |
Instance Attribute Details
#extras ⇒ Object
Returns the value of attribute extras.
4 5 6 |
# File 'lib/openstax/rescue_from/exception_options.rb', line 4 def extras @extras end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/openstax/rescue_from/exception_options.rb', line 4 def @message end |
#notify ⇒ Object
Returns the value of attribute notify.
4 5 6 |
# File 'lib/openstax/rescue_from/exception_options.rb', line 4 def notify @notify end |
#sorry ⇒ Object
Returns the value of attribute sorry.
4 5 6 |
# File 'lib/openstax/rescue_from/exception_options.rb', line 4 def sorry @sorry end |
#status_code ⇒ Object
Returns the value of attribute status_code.
4 5 6 |
# File 'lib/openstax/rescue_from/exception_options.rb', line 4 def status_code @status_code end |
Instance Method Details
#notify? ⇒ Boolean
21 22 23 |
# File 'lib/openstax/rescue_from/exception_options.rb', line 21 def notify? @notify end |