Class: EasyTalk::Builders::TypedArrayBuilder
- Inherits:
-
BaseBuilder
- Object
- BaseBuilder
- EasyTalk::Builders::TypedArrayBuilder
- Extended by:
- CollectionHelpers, T::Sig
- Defined in:
- lib/easy_talk/builders/typed_array_builder.rb
Overview
Builder class for array properties.
Constant Summary collapse
- VALID_OPTIONS =
{ min_items: { type: Integer, key: :minItems }, max_items: { type: Integer, key: :maxItems }, unique_items: { type: T::Boolean, key: :uniqueItems }, enum: { type: T::Array[T.untyped], key: :enum }, const: { type: T::Array[T.untyped], key: :const } }.freeze
Constants inherited from BaseBuilder
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from BaseBuilder
Instance Method Summary collapse
-
#initialize(name, type, constraints = {}) ⇒ TypedArrayBuilder
constructor
A new instance of TypedArrayBuilder.
Methods included from CollectionHelpers
Methods inherited from BaseBuilder
Constructor Details
#initialize(name, type, constraints = {}) ⇒ TypedArrayBuilder
Returns a new instance of TypedArrayBuilder.
23 24 25 26 27 28 |
# File 'lib/easy_talk/builders/typed_array_builder.rb', line 23 def initialize(name, type, constraints = {}) @name = name @type = type update_option_types super(name, { type: 'array' }, constraints, VALID_OPTIONS) end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
20 21 22 |
# File 'lib/easy_talk/builders/typed_array_builder.rb', line 20 def type @type end |