Base
Base class for Contract-phase type builders.
Contract phase runs once per contract with representation at registration time. Use it to generate contract-specific types based on the representation.
Example
ruby
module Builder
class Contract < Adapter::Builder::Contract::Base
def build
object(representation_class.root_key.singular.to_sym) do |object|
object.string(:id)
object.string(:name)
end
end
end
endInstance Methods
#api_class
#api_class
See also
#build
#build
Builds contract-level types.
Override this method to generate types based on the representation.
Returns
void
#contract_for
#contract_for(representation_class)
See also
#enum
#enum(name, values:, **options, &block)
See also
#enum?
#enum?(name)
See also
#import
#import(type_name, from:)
See also
#object
#object(name, **options, &block)
See also
#scoped_enum_name
#scoped_enum_name(name)
See also
#scoped_type_name
#scoped_type_name(name)
See also
#type?
#type?(name)
See also
#union
#union(name, **options, &block)
See also