Sha256: 4d77a83985beb161753503c0b73be88b3ad575d4a0984030b853a73bc5f122f7

Contents?: true

Size: 626 Bytes

Versions: 9

Compression:

Stored size: 626 Bytes

Contents

# frozen_string_literal: true

require_relative 'base_builder'

module EasyTalk
  module Builders
    # Builder class for boolean properties.
    class BooleanBuilder < BaseBuilder
      extend T::Sig

      # VALID_OPTIONS defines the valid options for a boolean property.
      VALID_OPTIONS = {
        enum: { type: T::Array[T::Boolean], key: :enum },
        default: { type: T::Boolean, key: :default }
      }.freeze

      sig { params(name: Symbol, constraints: Hash).void }
      def initialize(name, constraints = {})
        super(name, { type: 'boolean' }, constraints, VALID_OPTIONS)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
easy_talk-1.0.2 lib/easy_talk/builders/boolean_builder.rb
easy_talk-1.0.1 lib/easy_talk/builders/boolean_builder.rb
easy_talk-1.0.0 lib/easy_talk/builders/boolean_builder.rb
easy_talk-0.2.1 lib/easy_talk/builders/boolean_builder.rb
easy_talk-0.2.0 lib/easy_talk/builders/boolean_builder.rb
easy_talk-0.1.10 lib/easy_talk/builders/boolean_builder.rb
easy_talk-0.1.9 lib/easy_talk/builders/boolean_builder.rb
easy_talk-0.1.8 lib/easy_talk/builders/boolean_builder.rb
easy_talk-0.1.7 lib/easy_talk/builders/boolean_builder.rb