Class: MediaTypes::Scheme::EnumerationOfType
- Inherits:
-
Object
- Object
- MediaTypes::Scheme::EnumerationOfType
- Defined in:
- lib/media_types/scheme/enumeration_of_type.rb
Instance Method Summary collapse
-
#initialize(item_type, enumeration_type: Array, allow_empty: false) ⇒ EnumerationOfType
constructor
An attribute that expects a value of type
enumeration_typeand each item of typeitem_type. - #validate!(output, options, **_opts) ⇒ Object
Constructor Details
#initialize(item_type, enumeration_type: Array, allow_empty: false) ⇒ EnumerationOfType
An attribute that expects a value of type enumeration_type and each item of type item_type
14 15 16 17 18 19 20 |
# File 'lib/media_types/scheme/enumeration_of_type.rb', line 14 def initialize(item_type, enumeration_type: Array, allow_empty: false) self.item_type = item_type self.enumeration_type = enumeration_type self.allow_empty = allow_empty freeze end |
Instance Method Details
#validate!(output, options, **_opts) ⇒ Object
22 23 24 25 26 |
# File 'lib/media_types/scheme/enumeration_of_type.rb', line 22 def validate!(output, , **_opts) validate_enumeration!(output, ) && validate_not_empty!(output, ) && validate_items!(output, ) end |