Sha256: d7fd18c7061f120c8123bc582ce94438c91d492261d3f00c125eea9923d53586

Contents?: true

Size: 958 Bytes

Versions: 9

Compression:

Stored size: 958 Bytes

Contents

# frozen_string_literal: true

require_relative 'base_builder'

module EasyTalk
  module Builders
    # Builder class for integer properties.
    class IntegerBuilder < BaseBuilder
      extend T::Sig
      VALID_OPTIONS = {
        minimum: { type: Integer, key: :minimum },
        maximum: { type: Integer, key: :maximum },
        exclusive_minimum: { type: Integer, key: :exclusiveMinimum },
        exclusive_maximum: { type: Integer, key: :exclusiveMaximum },
        multiple_of: { type: Integer, key: :multipleOf },
        enum: { type: T::Array[Integer], key: :enum },
        const: { type: Integer, key: :const },
        default: { type: Integer, key: :default }
      }.freeze

      # Initializes a new instance of the IntegerBuilder class.
      sig { params(name: Symbol, constraints: Hash).void }
      def initialize(name, constraints = {})
        super(name, { type: 'integer' }, 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/integer_builder.rb
easy_talk-1.0.1 lib/easy_talk/builders/integer_builder.rb
easy_talk-1.0.0 lib/easy_talk/builders/integer_builder.rb
easy_talk-0.2.1 lib/easy_talk/builders/integer_builder.rb
easy_talk-0.2.0 lib/easy_talk/builders/integer_builder.rb
easy_talk-0.1.10 lib/easy_talk/builders/integer_builder.rb
easy_talk-0.1.9 lib/easy_talk/builders/integer_builder.rb
easy_talk-0.1.8 lib/easy_talk/builders/integer_builder.rb
easy_talk-0.1.7 lib/easy_talk/builders/integer_builder.rb