def method_missing(method, *params, &block)
        @endpoint_parts << method.to_s

        @endpoint_parts << params
        @endpoint_parts = @endpoint_parts.flatten!

        block&.call

        self || super
      end
def method_missing(method, *params, &block)
        @endpoint_parts << method.to_s

        @endpoint_parts << params
        @endpoint_parts = @endpoint_parts.flatten!

        block&.call

        self || super
      end
Overrides ruby's method_missing to allow creation of URLs through method calls.

 @example Adding a simple URL part
   request = Parliament::Request::UrlRequest.new(base_url: 'http://example.com')

   # url: http://example.com/people
   request.people

 @example Adding a simple URL part with parameters
   request = Parliament::Request::UrlRequest.new(base_url: 'http://example.com')

   # url: http://example.com/people/123456
   request.people('123456')

 @example Chaining URL parts and using hyphens
   request = Parliament::Request::UrlRequest.new(base_url: 'http://example.com')

   # url: http://example.com/people/123456/foo/bar/hello-world/7890
   request.people('123456').foo.bar('hello-world', '7890')

 @param [Symbol] method the 'method' (url part) we are processing.
 @param [Array<Object>] params parameters passed to the specified method (url part).
 @param [Block] block additional block (kept for compatibility with method_missing API).

 @return [Parliament::Request::UrlRequest] self (this is to allow method chaining).