Class: EasyTalk::Builders::NumberBuilder
- Inherits:
-
BaseBuilder
- Object
- BaseBuilder
- EasyTalk::Builders::NumberBuilder
- Defined in:
- lib/easy_talk/builders/number_builder.rb
Overview
Builder class for number properties.
Constant Summary collapse
- 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
Constants inherited from BaseBuilder
Instance Attribute Summary
Attributes inherited from BaseBuilder
Instance Method Summary collapse
-
#initialize(name, constraints = {}) ⇒ NumberBuilder
constructor
A new instance of NumberBuilder.
Methods inherited from BaseBuilder
Constructor Details
#initialize(name, constraints = {}) ⇒ NumberBuilder
Returns a new instance of NumberBuilder.
22 23 24 |
# File 'lib/easy_talk/builders/number_builder.rb', line 22 def initialize(name, constraints = {}) super(name, { type: 'number' }, constraints, VALID_OPTIONS) end |