Module: Faraday::CLI::Option::Validator
Constant Summary collapse
- ALLOWED_HTTP_METHODS =
%w(get head post put patch delete options)
Instance Method Summary collapse
Instance Method Details
#validate(argv, options_hash) ⇒ Object
6 7 8 9 10 |
# File 'lib/faraday/cli/option/validator.rb', line 6 def validate(argv,) validate_url(argv[0]) validate_http_method() validate_http_headers() end |
#validate_http_headers(options_hash) ⇒ Object
12 13 14 |
# File 'lib/faraday/cli/option/validator.rb', line 12 def validate_http_headers() alert('header is in malformed format!') if [:http_headers].any?{|pairs| pairs.length != 2 } end |