Sha256: 398122616e2a369c16b2407554862fadd77553d2987736439e1ffcca91726598

Contents?: true

Size: 1.5 KB

Versions: 55

Compression:

Stored size: 1.5 KB

Contents

# {{moduleName}}::{{classname}}

## Class instance methods

### `openapi_one_of`

Returns the list of classes defined in oneOf.

#### Example

```ruby
require '{{{gemName}}}'

{{moduleName}}::{{classname}}.openapi_one_of
# =>
{{#oneOf}}
{{#-first}}
# [
{{/-first}}
#   :'{{{.}}}'{{^-last}},{{/-last}}
{{#-last}}
# ]
{{/-last}}
{{/oneOf}}
```
{{#discriminator}}
{{#propertyName}}

### `openapi_discriminator_name`

Returns the discriminator's property name.

#### Example

```ruby
require '{{{gemName}}}'

{{moduleName}}::{{classname}}.openapi_discriminator_name
# => :'{{{.}}}'
```
{{/propertyName}}
{{#mappedModels}}
{{#-first}}

### `openapi_discriminator_name`

Returns the discriminator's mapping.

#### Example

```ruby
require '{{{gemName}}}'

{{moduleName}}::{{classname}}.openapi_discriminator_mapping
# =>
# {
{{/-first}}
#   :'{{{mappingName}}}' => :'{{{modelName}}}'{{^-last}},{{/-last}}
{{#-last}}
# }
{{/-last}}
{{/mappedModels}}
{{/discriminator}}

### build

Find the appropriate object from the `openapi_one_of` list and casts the data into it.

#### Example

```ruby
require '{{{gemName}}}'

{{moduleName}}::{{classname}}.build(data)
# => {{#oneOf}}{{#-first}}#<{{{.}}}:0x00007fdd4aab02a0>{{/-first}}{{/oneOf}}

{{moduleName}}::{{classname}}.build(data_that_doesnt_match)
# => nil
```

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| **data** | **Mixed** | data to be matched against the list of oneOf items |

#### Return type

{{#oneOf}}
- `{{{.}}}`
{{/oneOf}}
- `nil` (if no type matches)

Version data entries

55 entries across 55 versions & 6 rubygems

Version Path
mux_ruby-3.9.0 gen/templates/partial_oneof_module_doc.mustache
dropbox-sign-1.0.1 templates/partial_oneof_module_doc.mustache
dropbox-sign-1.0.0 templates/partial_oneof_module_doc.mustache
mux_ruby-3.8.0 gen/templates/partial_oneof_module_doc.mustache
dropbox-sign-1.0.0.pre.beta2301 templates/partial_oneof_module_doc.mustache
hellosign-ruby-sdk-6.0.0.pre.beta templates/partial_oneof_module_doc.mustache
mux_ruby-3.7.0 gen/templates/partial_oneof_module_doc.mustache
mux_ruby-3.6.0 gen/templates/partial_oneof_module_doc.mustache
mux_ruby-3.5.2 gen/templates/partial_oneof_module_doc.mustache
mux_ruby-3.5.1 gen/templates/partial_oneof_module_doc.mustache
mux_ruby-3.5.0 gen/templates/partial_oneof_module_doc.mustache
ruby-linstor-client-1.1.0 generator/template/partial_oneof_module_doc.mustache
mux_ruby-3.4.0 gen/templates/partial_oneof_module_doc.mustache
datadog_api_client-1.7.0 .generator/templates/partial_oneof_module_doc.mustache
mux_ruby-3.3.1 gen/templates/partial_oneof_module_doc.mustache
mux_ruby-3.3.0 gen/templates/partial_oneof_module_doc.mustache
datadog_api_client-1.6.0 .generator/templates/partial_oneof_module_doc.mustache
ruby-linstor-client-1.0.0 generator/template/partial_oneof_module_doc.mustache
kuapir-0.1.2 openapi-generator-templates/partial_oneof_module_doc.mustache
mux_ruby-3.2.0 gen/templates/partial_oneof_module_doc.mustache