Class: PetstoreApiClient::Authentication::None

Inherits:
Base
  • Object
show all
Defined in:
lib/petstore_api_client/authentication/none.rb

Overview

No authentication strategy (Null Object pattern) Used when no authentication is configured

This allows the authentication system to always have an authenticator without needing nil checks everywhere

Examples:

auth = None.new
auth.configured? # => false
auth.apply(env)  # Does nothing

Instance Method Summary collapse

Methods inherited from Base

#type

Instance Method Details

#apply(_env) ⇒ void

This method returns an undefined value.

Apply no authentication (does nothing)

Parameters:

  • _env (Faraday::Env)

    The request environment (unused)



22
23
24
# File 'lib/petstore_api_client/authentication/none.rb', line 22

def apply(_env)
  # Intentionally empty - no authentication to apply
end

#configured?Boolean

Check if authentication is configured

Returns:

  • (Boolean)

    Always false



29
30
31
# File 'lib/petstore_api_client/authentication/none.rb', line 29

def configured?
  false
end

#inspectString Also known as: to_s

String representation

Returns:

  • (String)


36
37
38
# File 'lib/petstore_api_client/authentication/none.rb', line 36

def inspect
  "#<#{self.class.name} (no authentication)>"
end