Class: ApimaticCalcu::SimpleCalculatorController
- Inherits:
-
BaseController
- Object
- BaseController
- ApimaticCalcu::SimpleCalculatorController
- Defined in:
- lib/apimatic_calcu/controllers/simple_calculator_controller.rb
Overview
SimpleCalculatorController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#get_calculate(options = {}) ⇒ OperationTypeEnum
Calculates the expression using the specified operation.
Methods inherited from BaseController
#initialize, #new_api_call_builder, #new_parameter, #new_request_builder, #new_response_handler, user_agent
Constructor Details
This class inherits a constructor from ApimaticCalcu::BaseController
Instance Method Details
#get_calculate(options = {}) ⇒ OperationTypeEnum
Calculates the expression using the specified operation. apply on the variables
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/apimatic_calcu/controllers/simple_calculator_controller.rb', line 15 def get_calculate( = {}) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/{operation}', Server::CALCULATOR) .template_param(new_parameter(['operation'], key: 'operation') .should_encode(true)) .query_param(new_parameter(['x'], key: 'x')) .query_param(new_parameter(['y'], key: 'y'))) .response(new_response_handler .deserializer(APIHelper.method(:deserialize_primitive_types)) .deserialize_into(proc do |response| response.to_s end) .is_primitive_response(true)) .execute end |