docs/Destination

FactPulse::Destination

Class instance methods

openapi_one_of

Returns the list of classes defined in oneOf.

Example

require 'factpulse'

FactPulse::Destination.openapi_one_of
# =>
# [
#   :'DestinationAFNOR',
#   :'DestinationChorusPro'
# ]

openapi_discriminator_name

Returns the discriminator’s property name.

Example

require 'factpulse'

FactPulse::Destination.openapi_discriminator_name
# => :'type'

openapi_discriminator_name

Returns the discriminator’s mapping.

Example

require 'factpulse'

FactPulse::Destination.openapi_discriminator_mapping
# =>
# {
#   :'afnor' => :'DestinationAFNOR',
#   :'chorus_pro' => :'DestinationChorusPro'
# }

build

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

Example

require 'factpulse'

FactPulse::Destination.build(data)
# => #

FactPulse::Destination.build(data_that_doesnt_match)
# => nil

Parameters

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

Return type

  • DestinationAFNOR
  • DestinationChorusPro
  • nil (if no type matches)