Class: ImgToScript::MK90ClientAPI::QueryHandler
- Inherits:
-
Object
- Object
- ImgToScript::MK90ClientAPI::QueryHandler
- Defined in:
- lib/img_to_script/mk90_client_api/query_handler.rb
Overview
Handles query.
Instance Method Summary collapse
-
#call(query) ⇒ Array<String>
Handle query: 1.
Instance Method Details
#call(query) ⇒ Array<String>
Handle query:
-
validate input query;
-
if query is correct: configure and call an ImgToScript task instance;
-
return result of the ImgToScript::Task call.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/img_to_script/mk90_client_api/query_handler.rb', line 21 def call(query) valid_query = _validate_input(query) task = _init_task(valid_query) image = _prepare_image( _read_image(valid_query[:image]) ) task.run( image: image, scr_width: ImgToScript::Languages::MK90Basic::SCR_WIDTH, scr_height: ImgToScript::Languages::MK90Basic::SCR_HEIGHT ) end |