Sha256: b62c91da896665228873f0aed603af2107d58a01df570222265bfc2c6cc23943
Contents?: true
Size: 1.05 KB
Versions: 7
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true require_relative 'base_builder' module EasyTalk module Builders # Builder class for number properties. class NumberBuilder < BaseBuilder VALID_OPTIONS = { multiple_of: { type: T.any(Integer, Float), key: :multipleOf }, minimum: { type: T.any(Integer, Float), key: :minimum }, maximum: { type: T.any(Integer, Float), key: :maximum }, exclusive_minimum: { type: T.any(Integer, Float), key: :exclusiveMinimum }, exclusive_maximum: { type: T.any(Integer, Float), key: :exclusiveMaximum }, enum: { type: T::Array[T.any(Integer, Float)], key: :enum }, const: { type: T.any(Integer, Float), key: :const }, default: { type: T.any(Integer, Float), key: :default } }.freeze # Initializes a new instance of the NumberBuilder class. sig { params(name: Symbol, _type: T.untyped, constraints: Hash).void } def initialize(name, _type = nil, constraints = {}) super(name, { type: 'number' }, constraints, VALID_OPTIONS) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems