Class: RedisMonitor::Controllers::BaseController
- Inherits:
-
Object
- Object
- RedisMonitor::Controllers::BaseController
- Includes:
- Helpers::BaseHelper, Helpers::LayoutsHelper
- Defined in:
- lib/controllers/base_controller.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #execute(action) ⇒ Object
-
#initialize(opts = {}) ⇒ BaseController
constructor
A new instance of BaseController.
- #redis_not_available ⇒ Object
Methods included from Helpers::LayoutsHelper
Methods included from Helpers::BaseHelper
Constructor Details
#initialize(opts = {}) ⇒ BaseController
Returns a new instance of BaseController.
12 13 14 15 |
# File 'lib/controllers/base_controller.rb', line 12 def initialize(opts = {}) @context = opts.delete(:context) @params = opts end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
7 8 9 |
# File 'lib/controllers/base_controller.rb', line 7 def context @context end |
#params ⇒ Object
Returns the value of attribute params.
7 8 9 |
# File 'lib/controllers/base_controller.rb', line 7 def params @params end |
Instance Method Details
#execute(action) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/controllers/base_controller.rb', line 17 def execute(action) begin send(action) rescue RedisMonitor::Errors::RedisNotAvailable redis_not_available end end |