Class: BetterAuth::Auth
- Inherits:
-
Object
- Object
- BetterAuth::Auth
- Defined in:
- lib/better_auth/auth.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#error_codes ⇒ Object
readonly
Returns the value of attribute error_codes.
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(options = {}) ⇒ Auth
constructor
A new instance of Auth.
Constructor Details
#initialize(options = {}) ⇒ Auth
Returns a new instance of Auth.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/better_auth/auth.rb', line 7 def initialize( = {}) @options = Configuration.new() @context = Context.new(@options) @context.set_adapter(build_adapter) @context.set_internal_adapter(Adapters::InternalAdapter.new(@context.adapter, @options)) @plugin_registry = PluginRegistry.new(@context) @plugin_registry.run_init! @error_codes = build_error_codes @endpoints = build_endpoints Router.check_endpoint_conflicts(@options, @options.logger) @api = API.new(@context, @endpoints) @handler = Router.new(@context, @endpoints) end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
5 6 7 |
# File 'lib/better_auth/auth.rb', line 5 def api @api end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
5 6 7 |
# File 'lib/better_auth/auth.rb', line 5 def context @context end |
#error_codes ⇒ Object (readonly)
Returns the value of attribute error_codes.
5 6 7 |
# File 'lib/better_auth/auth.rb', line 5 def error_codes @error_codes end |
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
5 6 7 |
# File 'lib/better_auth/auth.rb', line 5 def handler @handler end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/better_auth/auth.rb', line 5 def @options end |
Instance Method Details
#call(env) ⇒ Object
21 22 23 |
# File 'lib/better_auth/auth.rb', line 21 def call(env) handler.call(env) end |