Class: Rhoconnect::Handler::PluginCallbacks::Runner
- Inherits:
-
Object
- Object
- Rhoconnect::Handler::PluginCallbacks::Runner
- Includes:
- Helpers::Binding
- Defined in:
- lib/rhoconnect/handler/plugin_callbacks/runner.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
Returns the value of attribute model.
-
#params ⇒ Object
Returns the value of attribute params.
-
#route_handler ⇒ Object
Returns the value of attribute route_handler.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(route_handler, model, params = {}) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Methods included from Helpers::Binding
Constructor Details
#initialize(route_handler, model, params = {}) ⇒ Runner
Returns a new instance of Runner.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rhoconnect/handler/plugin_callbacks/runner.rb', line 9 def initialize(route_handler, model, params = {}) raise ArgumentError.new(UNKNOWN_SOURCE) unless (model and model.source) raise ArgumentError.new('Invalid app for source') unless model.source.app raise ArgumentError.new('Invalid plugin_callbacks handler') unless route_handler # if handler is not bound - bind it to self # normally it should be bound to a Controller's instance @source = model.source @model = model @route_handler = bind_handler(:plugin_callback_handler_method, route_handler) @params = params end |
Instance Attribute Details
#model ⇒ Object
Returns the value of attribute model.
5 6 7 |
# File 'lib/rhoconnect/handler/plugin_callbacks/runner.rb', line 5 def model @model end |
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'lib/rhoconnect/handler/plugin_callbacks/runner.rb', line 5 def params @params end |
#route_handler ⇒ Object
Returns the value of attribute route_handler.
5 6 7 |
# File 'lib/rhoconnect/handler/plugin_callbacks/runner.rb', line 5 def route_handler @route_handler end |
#source ⇒ Object
Returns the value of attribute source.
5 6 7 |
# File 'lib/rhoconnect/handler/plugin_callbacks/runner.rb', line 5 def source @source end |
Instance Method Details
#run ⇒ Object
22 23 24 |
# File 'lib/rhoconnect/handler/plugin_callbacks/runner.rb', line 22 def run @route_handler.call end |