Maxwell.Builder.Util (maxwell v2.4.0) View Source

Utils for builder

Link to this section Summary

Functions

Make sure all list in allow_methods, otherwise raise ArgumentError.

Global default adapter.

Serialize http method to atom lists.

Link to this section Functions

Link to this function

allow_methods?(list, allow_methods)

View Source

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

Global default adapter.

Link to this function

serialize_method_to_atom(methods, default_methods)

View Source

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]