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_type
and each item of typeitem_type
. - #inspect ⇒ Object
- #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
16 17 18 19 20 21 22 |
# File 'lib/media_types/scheme/enumeration_of_type.rb', line 16 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
#inspect ⇒ Object
30 31 32 |
# File 'lib/media_types/scheme/enumeration_of_type.rb', line 30 def inspect "[Scheme::EnumerationOfType #{item_type} collection=#{enumeration_type} empty=#{allow_empty}]" end |
#validate!(output, options, **_opts) ⇒ Object
24 25 26 27 28 |
# File 'lib/media_types/scheme/enumeration_of_type.rb', line 24 def validate!(output, , **_opts) validate_enumeration!(output, ) && validate_not_empty!(output, ) && validate_items!(output, ) end |