Class: Rhoconnect::Handler::Changes::Runner
- Inherits:
-
Object
- Object
- Rhoconnect::Handler::Changes::Runner
- Defined in:
- lib/rhoconnect/handler/changes/runner.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#engine ⇒ Object
Returns the value of attribute engine.
-
#model ⇒ Object
Returns the value of attribute model.
-
#operations ⇒ Object
Returns the value of attribute operations.
-
#params ⇒ Object
Returns the value of attribute params.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(operations, model, client, route_handler, params = {}) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(operations, model, client, route_handler, params = {}) ⇒ Runner
Returns a new instance of Runner.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rhoconnect/handler/changes/runner.rb', line 7 def initialize(operations,model,client,route_handler, params = {}) raise ArgumentError.new(UNKNOWN_CLIENT) unless client raise ArgumentError.new(UNKNOWN_SOURCE) unless (model and model.source) raise ArgumentError.new('Invalid app for source') unless model.source.app @source,@client = model.source,client @model = model @client.last_sync = Time.now if @client @params = params @operations = operations @engine = Rhoconnect::Handler::Changes::Engine.new(@operations, @model, route_handler, @params) end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/rhoconnect/handler/changes/runner.rb', line 5 def client @client end |
#engine ⇒ Object
Returns the value of attribute engine.
5 6 7 |
# File 'lib/rhoconnect/handler/changes/runner.rb', line 5 def engine @engine end |
#model ⇒ Object
Returns the value of attribute model.
5 6 7 |
# File 'lib/rhoconnect/handler/changes/runner.rb', line 5 def model @model end |
#operations ⇒ Object
Returns the value of attribute operations.
5 6 7 |
# File 'lib/rhoconnect/handler/changes/runner.rb', line 5 def operations @operations end |
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'lib/rhoconnect/handler/changes/runner.rb', line 5 def params @params end |
#source ⇒ Object
Returns the value of attribute source.
5 6 7 |
# File 'lib/rhoconnect/handler/changes/runner.rb', line 5 def source @source end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/rhoconnect/handler/changes/runner.rb', line 20 def run _process_blobs(params) processed = 0 operations.each do |op| key,value = op,params[op] processed += _receive_cud(key,value) if value end @engine.do_cud end |