Class: Rhoconnect::Handler::Search::Runner
- Inherits:
-
Object
- Object
- Rhoconnect::Handler::Search::Runner
- Defined in:
- lib/rhoconnect/handler/search/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.
-
#p_size ⇒ Object
Returns the value of attribute p_size.
-
#params ⇒ Object
Returns the value of attribute params.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(model, client, route_handler, params = {}) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(model, client, route_handler, params = {}) ⇒ Runner
Returns a new instance of Runner.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rhoconnect/handler/search/runner.rb', line 8 def initialize(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,@p_size = model.source,client,params[:p_size] ? params[:p_size].to_i : 500 @model = model @client.last_sync = Time.now if @client @params = params @engine = Rhoconnect::Handler::Search::Engine.new(@model, @client, route_handler, @params) end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/rhoconnect/handler/search/runner.rb', line 6 def client @client end |
#engine ⇒ Object
Returns the value of attribute engine.
6 7 8 |
# File 'lib/rhoconnect/handler/search/runner.rb', line 6 def engine @engine end |
#model ⇒ Object
Returns the value of attribute model.
6 7 8 |
# File 'lib/rhoconnect/handler/search/runner.rb', line 6 def model @model end |
#p_size ⇒ Object
Returns the value of attribute p_size.
6 7 8 |
# File 'lib/rhoconnect/handler/search/runner.rb', line 6 def p_size @p_size end |
#params ⇒ Object
Returns the value of attribute params.
6 7 8 |
# File 'lib/rhoconnect/handler/search/runner.rb', line 6 def params @params end |
#source ⇒ Object
Returns the value of attribute source.
6 7 8 |
# File 'lib/rhoconnect/handler/search/runner.rb', line 6 def source @source end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rhoconnect/handler/search/runner.rb', line 20 def run if params return _resend_search_result if params[:token] and params[:resend] if params[:token] and !_ack_search(params[:token]) formatted_result = _format_search_result _delete_search return formatted_result end end _do_search end |