Class: Braintrust::Contrib::Rails::Server::Engine
- Inherits:
-
Rails::Engine
- Object
- Rails::Engine
- Braintrust::Contrib::Rails::Server::Engine
- Defined in:
- lib/braintrust/contrib/rails/server/engine.rb
Class Method Summary collapse
- .auth_strategy ⇒ Object
-
.configure {|config| ... } ⇒ Object
Support the explicit ‘|config|` style used by this integration while still delegating zero-arity DSL blocks to Rails’ native implementation.
-
.eval_service ⇒ Object
Long-lived so the state cache persists across requests.
-
.evaluators ⇒ Object
Class-level helpers that read from engine config.
- .list_service ⇒ Object
Class Method Details
.auth_strategy ⇒ Object
26 27 28 |
# File 'lib/braintrust/contrib/rails/server/engine.rb', line 26 def self.auth_strategy resolve_auth(config.auth) end |
.configure {|config| ... } ⇒ Object
Support the explicit ‘|config|` style used by this integration while still delegating zero-arity DSL blocks to Rails’ native implementation.
41 42 43 44 |
# File 'lib/braintrust/contrib/rails/server/engine.rb', line 41 def self.configure(&block) return super if block&.arity == 0 yield config if block end |
.eval_service ⇒ Object
Long-lived so the state cache persists across requests.
35 36 37 |
# File 'lib/braintrust/contrib/rails/server/engine.rb', line 35 def self.eval_service @eval_service ||= Braintrust::Server::Services::Eval.new(-> { config.evaluators }) end |
.evaluators ⇒ Object
Class-level helpers that read from engine config.
22 23 24 |
# File 'lib/braintrust/contrib/rails/server/engine.rb', line 22 def self.evaluators config.evaluators end |
.list_service ⇒ Object
30 31 32 |
# File 'lib/braintrust/contrib/rails/server/engine.rb', line 30 def self.list_service Braintrust::Server::Services::List.new(-> { config.evaluators }) end |