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
datadog_api_client-1.5.0 .generator/templates/partial_oneof_module_doc.mustache
mux_ruby-3.1.0 gen/templates/partial_oneof_module_doc.mustache
mux_ruby-3.0.0 gen/templates/partial_oneof_module_doc.mustache
datadog_api_client-1.4.0 .generator/templates/partial_oneof_module_doc.mustache
mux_ruby-2.2.0 gen/templates/partial_oneof_module_doc.mustache
datadog_api_client-1.3.0 .generator/templates/partial_oneof_module_doc.mustache
mux_ruby-2.1.1 gen/templates/partial_oneof_module_doc.mustache
mux_ruby-2.1.0 gen/templates/partial_oneof_module_doc.mustache
mux_ruby-2.0.0 gen/templates/partial_oneof_module_doc.mustache
datadog_api_client-1.2.0 .generator/templates/partial_oneof_module_doc.mustache
mux_ruby-2.0.0.pre.rc.2 gen/templates/partial_oneof_module_doc.mustache
datadog_api_client-1.1.0 .generator/templates/partial_oneof_module_doc.mustache
mux_ruby-2.0.0.pre.rc.1 gen/templates/partial_oneof_module_doc.mustache
datadog_api_client-1.0.0 .generator/templates/partial_oneof_module_doc.mustache
datadog_api_client-1.0.0.beta.3 .generator/templates/partial_oneof_module_doc.mustache