[ruby] document the *_with_http_info methods (#8094)

This commit is contained in:
Julien Feltesse
2020-12-05 19:27:49 +09:00
committed by GitHub
parent 38dbcdd752
commit adcf54bc09
118 changed files with 1877 additions and 448 deletions

View File

@@ -5,7 +5,7 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
## Code Sample
## Example
```ruby
require 'petstore'

View File

@@ -5,7 +5,7 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
## Code Sample
## Example
```ruby
require 'petstore'

View File

@@ -16,10 +16,9 @@ Use alias to array
Use alias to array
### Example
### Examples
```ruby
# load the gem
require 'petstore'
api_instance = Petstore::UsageApi.new
@@ -28,11 +27,29 @@ opts = {
}
begin
#Use alias to array
# Use alias to array
result = api_instance.array(opts)
p result
rescue Petstore::ApiError => e
puts "Exception when calling UsageApi->array: #{e}"
puts "Error when calling UsageApi->array: #{e}"
end
```
#### Using the array_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> <Array(Object, Integer, Hash)> array_with_http_info(opts)
```ruby
begin
# Use alias to array
data, status_code, headers = api_instance.array_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Object
rescue Petstore::ApiError => e
puts "Error when calling UsageApi->array_with_http_info: #{e}"
end
```
@@ -64,10 +81,9 @@ Use alias to map
Use alias to map
### Example
### Examples
```ruby
# load the gem
require 'petstore'
api_instance = Petstore::UsageApi.new
@@ -76,11 +92,29 @@ opts = {
}
begin
#Use alias to map
# Use alias to map
result = api_instance.map(opts)
p result
rescue Petstore::ApiError => e
puts "Exception when calling UsageApi->map: #{e}"
puts "Error when calling UsageApi->map: #{e}"
end
```
#### Using the map_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> <Array(Object, Integer, Hash)> map_with_http_info(opts)
```ruby
begin
# Use alias to map
data, status_code, headers = api_instance.map_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Object
rescue Petstore::ApiError => e
puts "Error when calling UsageApi->map_with_http_info: #{e}"
end
```