Sha256: 22d14ed4eb4c0d92562dc5847d46082cbec4327823897a2ffd0851e5cc6f4776
Contents?: true
Size: 469 Bytes
Versions: 10
Compression:
Stored size: 469 Bytes
Contents
module OptionsManager def require_options(options, required_params) missing_args = [] required_params.each do |param| missing_args << param.to_s if options[param].nil? end raise ArgumentError, "Missing required argument: #{missing_args.join(',')}" unless missing_args.empty? end def validate_option_in_list(option, list) raise ArgumentError, "Option: #{option} should be one of #{list.inspect}" unless list.include?(option) end end
Version data entries
10 entries across 10 versions & 1 rubygems