Class: Square::Types::CatalogObject

Inherits:
Internal::Types::Model show all
Extended by:
Internal::Types::Union
Defined in:
lib/square/types/catalog_object.rb

Overview

The wrapper object for the catalog entries of a given object type.

Depending on the ‘type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object.

For example, if ‘type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance.

In general, if ‘type=<OBJECT_TYPE>`, the `CatalogObject` instance must have the `<OBJECT_TYPE>`-specific data set on the `<object_type>_data` attribute. The resulting `CatalogObject` instance is also a `Catalog<ObjectType>` instance.

For a more detailed discussion of the Catalog data model, please see the [Design a Catalog](developer.squareup.com/docs/catalog-api/design-a-catalog) guide.

Method Summary

Methods included from Internal::Types::Union

coerce, discriminant, load, member, member?, members

Methods included from Internal::Types::Type

#coerce, #strict!, #strict?

Methods included from Internal::JSON::Serializable

#dump, #load

Methods inherited from Internal::Types::Model

#==, ===, add_extra_field_definition, coerce, extra_fields, field, fields, #initialize, #inspect, literal, load, #to_h

Constructor Details

This class inherits a constructor from Square::Internal::Types::Model