Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Simple calculator API hosted on APIMATIC
Install the gem from the command line:
gem install test25012021 -v 3.0.0
Or add the gem to your Gemfile and run bundle
:
gem 'test25012021', '3.0.0'
For additional gem details, see the RubyGems page for the test25012021 gem.
The following parameters are configurable for the API Client:
Parameter | Type | Description |
---|---|---|
environment | Environment | The API environment. Default: Environment.PRODUCTION |
timeout | Float | The value to use for connection timeout. Default: 60 |
max_retries | Integer | The number of times to retry an endpoint call if it fails. Default: 0 |
retry_interval | Float | Pause in seconds between retries. Default: 1 |
backoff_factor | Float | The amount to multiply each successive retry's interval amount by in order to provide backoff. Default: 1 |
The API client can be initialized as follows:
client = ApimaticCalculator::Client.new(
environment: Environment::PRODUCTION,
)
To run the tests, navigate to the root directory of the SDK in your terminal and execute the following command:
rake
The gateway for the SDK. This class acts as a factory for the Controllers and also holds the configuration of the SDK.
Name | Description |
---|---|
simple_calculator | Provides access to SimpleCalculatorController |
An instance of the SimpleCalculatorController
class can be accessed from the API Client.
simple_calculator_controller = client.simple_calculator
Calculates the expression using the specified operation.
:information_source: Note This endpoint does not require authentication.
def get_calculate(options = {})
Parameter | Type | Tags | Description |
---|---|---|---|
operation | OperationTypeEnum | Template, Required | The operator to apply on the variables |
x | Float | Query, Required | The LHS value |
y | Float | Query, Required | The RHS value |
Float
collect = {}
operation = OperationTypeEnum::MULTIPLY
collect['operation'] = operation;
x = 222.14
collect['x'] = x;
y = 165.14
collect['y'] = y;
result = simple_calculator_controller.get_calculate(collect)
Possible operators are sum, subtract, multiply, divide
OperationTypeEnum
Name | Description |
---|---|
SUM | Represents the sum operator |
SUBTRACT | Represents the subtract operator |
MULTIPLY | Represents the multiply operator |
DIVIDE | Represents the divide operator |
API utility class.
Name | Return Type | Description |
---|---|---|
json_deserialize | Hash | Deserializes a JSON string to a Ruby Hash. |
rfc3339 | DateTime | Safely converts a string into an RFC3339 DateTime object. |
Http response received.
Name | Type | Description |
---|---|---|
status_code | Integer | The status code returned by the server. |
reason_phrase | String | The reason phrase returned by the server. |
headers | Hash | Response headers. |
raw_body | String | Response body. |
request | HttpRequest | The request that resulted in this response. |
Represents a single Http Request.
Name | Type | Tag | Description |
---|---|---|---|
http_method | HttpMethodEnum | The HTTP method of the request. | |
query_url | String | The endpoint URL for the API request. | |
headers | Hash | Optional | Request headers. |
parameters | Hash | Optional | Request body. |
FAQs
Unknown package
We found that test25012021 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.