Class: ExceptionHandler::Config
- Inherits:
-
Object
- Object
- ExceptionHandler::Config
- Defined in:
- lib/exception_handler/config.rb
Constant Summary collapse
- TABLE_NAME =
Default Table Name Has to be “errors” because “exceptions” is a reserved word
:errors- DEFAULTS =
Defaults stackoverflow.com/a/8917301/1143732
{ dev: false, #-> defaults to "false" for dev mode db: false, #-> defaults to :errors if true, else use "table_name" / :table_name email: false, #-> need to integrate social: { :facebook => 'frontline.utilities', :twitter => 'frontlineutils', :youtube => 'frontlineutils', :linkedin => 'frontline-utilities', :fusion => 'frontlineutils', :url => { :facebook => 'https://facebook.com', :twitter => 'http://twitter.com', :youtube => 'https://youtube.com/user', :linkedin => 'https://linkedin.com/company', :fusion => 'https://frontlinefusion.com', }, }, layouts: { '404' => nil, #-> 404 Callback (needs improving big time) Use the following: '404' => <<-EOF redirect_to root_url, notice: "Hello" EOF '400' => nil, #-> layout for 400 error code (404 should only be used as response) '500' => 'exception' }, }
Instance Attribute Summary collapse
-
#db ⇒ Object
DB.
-
#dev ⇒ Object
Instace Objects.
-
#email ⇒ Object
Instace Objects.
-
#layouts ⇒ Object
Instace Objects.
-
#social ⇒ Object
Instace Objects.
Instance Method Summary collapse
-
#initialize(values = nil) ⇒ Config
constructor
Init.
Constructor Details
#initialize(values = nil) ⇒ Config
Init
18 19 20 21 22 23 |
# File 'lib/exception_handler/config.rb', line 18 def initialize values=nil defaults = values.present? ? Config::DEFAULTS.deep_merge!(values) : Config::DEFAULTS defaults.each do |k,v| instance_variable_set("@#{k}",v) #-> http://apidock.com/ruby/Object/instance_variable_set end end |
Instance Attribute Details
#db ⇒ Object
DB
13 14 15 |
# File 'lib/exception_handler/config.rb', line 13 def db @db end |
#dev ⇒ Object
Instace Objects
13 14 15 |
# File 'lib/exception_handler/config.rb', line 13 def dev @dev end |
#email ⇒ Object
Instace Objects
13 14 15 |
# File 'lib/exception_handler/config.rb', line 13 def email @email end |
#layouts ⇒ Object
Instace Objects
13 14 15 |
# File 'lib/exception_handler/config.rb', line 13 def layouts @layouts end |
#social ⇒ Object
Instace Objects
13 14 15 |
# File 'lib/exception_handler/config.rb', line 13 def end |