module StubRequests::Concerns::RegisterVerb

Module RegisterVerb provides <description> @since 0.1.10

@author Mikael Henriksson <mikael@zoolutions.se>

Public Instance Methods

any(path, as:) click to toggle source

Convenience wrapper for register

@example **Register a get endpoint** . get(“documents/:id”, as: :documents_show)

@param [String] path the path to the endpoint @param [Symbol] as the id of the endpoint

@return [Endpoint] the registered endpoint

# File lib/stub_requests/concerns/register_verb.rb, line 25
def any(path, as:) # rubocop:disable Naming/UncommunicativeMethodParamName
  register(as, __method__, path)
end
delete(path, as:) click to toggle source

Register a :delete endpoint

@example **Register a delete endpoint** . delete(“documents/:id”, as: :documents_destroy)

@param [String] path the path to the endpoint @param [Symbol] as the id of the endpoint

@return [Endpoint] the registered endpoint

# File lib/stub_requests/concerns/register_verb.rb, line 105
def delete(path, as:) # rubocop:disable Naming/UncommunicativeMethodParamName
  register(as, __method__, path)
end
get(path, as:) click to toggle source

Convenience wrapper for register

@example **Register a get endpoint** . get(“documents/:id”, as: :documents_show)

@param [String] path the path to the endpoint @param [Symbol] as the id of the endpoint

@return [Endpoint] the registered endpoint

# File lib/stub_requests/concerns/register_verb.rb, line 41
def get(path, as:) # rubocop:disable Naming/UncommunicativeMethodParamName
  register(as, __method__, path)
end
patch(path, as:) click to toggle source

Register a :patch endpoint

@example **Register a patch endpoint** . patch(“documents/:id”, as: :documents_update)

@param [String] path the path to the endpoint @param [Symbol] as the id of the endpoint

@return [Endpoint] the registered endpoint

# File lib/stub_requests/concerns/register_verb.rb, line 73
def patch(path, as:) # rubocop:disable Naming/UncommunicativeMethodParamName
  register(as, __method__, path)
end
post(path, as:) click to toggle source

Register a :post endpoint

@example **Register a post endpoint** . post(“documents”, as: :documents_create)

@param [String] path the path to the endpoint @param [Symbol] as the id of the endpoint

@return [Endpoint] the registered endpoint

# File lib/stub_requests/concerns/register_verb.rb, line 57
def post(path, as:) # rubocop:disable Naming/UncommunicativeMethodParamName
  register(as, __method__, path)
end
put(path, as:) click to toggle source

Register a :put endpoint

@example **Register a put endpoint** . put(“documents/:id”, as: :documents_update)

@param [String] path the path to the endpoint @param [Symbol] as the id of the endpoint

@return [Endpoint] the registered endpoint

# File lib/stub_requests/concerns/register_verb.rb, line 89
def put(path, as:) # rubocop:disable Naming/UncommunicativeMethodParamName
  register(as, __method__, path)
end