Module: Hextech::Mixins::ArgumentChecks
- Included in:
- Adapter
- Defined in:
- lib/hextech/mixins/argument_checks.rb
Instance Method Summary collapse
Instance Method Details
#validate_collection_for(collection:, option:) ⇒ Object
6 7 8 9 10 |
# File 'lib/hextech/mixins/argument_checks.rb', line 6 def validate_collection_for(collection:, option:) return if collection.empty? || collection.include?(option) raise Hextech::InvalidArgument, "Invalid argument: must be one of #{collection.join(', ')}." end |