maxwell v2.2.2 Maxwell.Builder.Util

Utils for builder

Summary

Functions

Make sure all list in allow_methods, otherwise raise ArgumentError

Global default adapter

Serialize http method to atom lists

Functions

allow_methods?(list, allow_methods)

Make sure all list in allow_methods, otherwise raise ArgumentError.

Examples

iex> allow_methods?([:Get], [:post, :head, :get])
   ** (ArgumentError) http methods don't support Get
default_adapter()

Global default adapter.

serialize_method_to_atom(methods, default_methods)

Serialize http method to atom lists.

  • methods - http methods list, for example: ~w(get), [:get], ["get"]
  • default_methods - all http method lists.
  • raise ArgumentError when method is not atom list, string list or ~w(get put).

Examples

  [:get, :head, :delete, :trace, :options, :post, :put, :patch]