Class: EasyTalk::Builders::BooleanBuilder

Inherits:
BaseBuilder
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/easy_talk/builders/boolean_builder.rb

Overview

Builder class for boolean properties.

Constant Summary collapse

VALID_OPTIONS =

VALID_OPTIONS defines the valid options for a boolean property.

{
  enum: { type: T::Array[T::Boolean], key: :enum },
  default: { type: T::Boolean, key: :default }
}.freeze

Constants inherited from BaseBuilder

EasyTalk::Builders::BaseBuilder::COMMON_OPTIONS

Instance Attribute Summary

Attributes inherited from BaseBuilder

#name, #options, #schema

Instance Method Summary collapse

Methods inherited from BaseBuilder

#build, collection_type?

Constructor Details

#initialize(name, constraints = {}) ⇒ BooleanBuilder

Returns a new instance of BooleanBuilder.



18
19
20
# File 'lib/easy_talk/builders/boolean_builder.rb', line 18

def initialize(name, constraints = {})
  super(name, { type: 'boolean' }, constraints, VALID_OPTIONS)
end